BuddyJoe
BuddyJoe

Reputation: 71101

Standard output from MSTest, NUnit, MbUnit, xUnit.NET test runners

How do you, in any of the common .NET testing frameworks MSTest, NUnit, MbUnit, or xUnit.NET, get the command line test runner to output a simple yes/no or true/false or 1/0 on whether all the tests passed or failed?

I'm open to workarounds like:

  1. No output if all the tests passed, output if anything fails.
  2. Count of tests that failed. I could look for zero or non-zero values.
  3. Other things similar to #1 or #2

Which of these frameworks provide this kind of capability?

I did some playing with MSTest today and didn't see a way to make MSTest.exe output something I could use.

Upvotes: 1

Views: 2000

Answers (3)

Matt Enright
Matt Enright

Reputation: 7474

Have a look at Gallio, a framework and other tools (test runner, etc.) that MbUnit is built on, but that also handles the outputs MSTest, NUnit, RSpec, etc.

While that isn't exactly what you asked for, if you use the output from the Gallio test-runner, then you've got free support for the test formats - it's essentially a standard output.

Upvotes: 2

Preet Sangha
Preet Sangha

Reputation: 65496

They all output XML if you want (especially MSTest). You can use XSLT like my version for MSTest.

Upvotes: 3

Serge van den Oever
Serge van den Oever

Reputation: 4392

MSTest and most other runners return an exitcode you can check on.

Upvotes: 0

Related Questions