0

I run nunit-console using the following command line:

nunit-console-x86.exe IntegrationTests.dll /include:InstallerTests,SanityTests,DebuggingTests /xml=IntegrationTestResults.xml /nologo /labels /timeout:960000

My issue is that the test runs in alphabetic order. Is there any way to force NUnit to run the tests based on category order we mention in command line /include switch? I would like to run Installer tests first then Sanity and finally Debugging tests.

One partial solution is to run individual categories separately but I want the test results in single XML file so that it is easy to manipulate results.

forsvarir
  • 10,749
  • 6
  • 46
  • 77
Ashok Mazumder
  • 149
  • 1
  • 2
  • 8

1 Answers1

0

The short answer is No, there isn't currently a way to get nunit-console to do what you are asking.

Generally, unit-tests (which is the primary target audience for nunit) are written such that order of execution doesn't matter. Given that, it seems unlikely that adding order based execution to nunit-console is likely to be a change that's likely to arrive any time soon.

Post-processing the result file is going to be the easiest option.

There are however other approaches that can be used to control the order of execution. For example this one takes advantage of the fact that NUnit executes tests in alphabetical order to arrange tests before execution.

forsvarir
  • 10,749
  • 6
  • 46
  • 77