Graviton
Graviton

Reputation: 83244

How to get nunit console 3 to output failed and ignored tests (only) to text files?

I understand that nunit console 3 can write to TestResult.xml after running the tests, where the TestResult.xml is located inside the directory specified by --work parameter.

But from what I can tell, TestResult.xml contains too many (irrelevant) details, that I don't need to fix my unit tests errors. All I need is just the failed or ignored test cases, just like what is displayed in command line prompt when I am running nunit console in it.

How to configure the parameters for nunit console 3 so that it only gives me failed or ignored test cases?

Upvotes: 0

Views: 918

Answers (1)

Julo
Julo

Reputation: 1120

Sorry, I'm a few months late (unfortunately I came across this problem only now). But as far as I searched, the only possibility is to use XSL transformation. There are some applications that can convert the XML report file, but... I tested a few, but unfortunately the output was not that was I need.

Therefore I created a simple NUnit3summary application that can transform the standard XML output file to text file. I was surprised that nobody until now made something like this (or at least did not publish it). It were only two hours of work (first working version) and a few more to finish it to stare ready for publishing.

It is only a simple application that was aimed for my needs. You can use filtration for now only with another application, e.g.: NUnit3summary.exe TestResult.xml | grep Failed >FailedTests.txt

You can see a practical application here (this is also the project where the application was needed, because of too many errors in unit tests).

Upvotes: 1

Related Questions