Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to customize NUnit XML output?

Tags:

nunit

I'm looking at NUnit XML output right now and wonder if it's possible to generate the output for failures only.

I mean, if a test passes OK, no XML output gets generated for it at all.

XSLT is not an option here. I don't want XML output for passed tests at all: if I don't need the details about the passed tests, I don't want the system to spend time generating those details.*

The idea is, XML output tend to be quite large if you have a lot of tests, but 80% of the time you're after failures anyway. For such cases, I'd like to run my tests in such a way that only information on failures get generated.

like image 780
andreister Avatar asked Feb 08 '10 14:02

andreister


2 Answers

You can specify an XSLT file when you run the NUnit console runner to customise the generated file:

nunit-console /transform:failures.xslt nunit.tests.dll

The default XML file is generated using this XSLT file which can be easily modified to report only failures.

like image 179
Keith Bloom Avatar answered Dec 31 '22 19:12

Keith Bloom


I posted this question to the NUnit Google Groups group, and Charlie Poole confirmed that there's no such option.

like image 40
andreister Avatar answered Dec 31 '22 18:12

andreister