问题
nunit3-console TestData.dll /include:SmokeTests
but with nunit v3 I get back:
Invalid argument: /include:SmokeTests
I try to check command line parameters here http://nunit.org/index.php?p=consoleCommandLine&r=3.0
but page does not exist. Anyone know what has changed?
回答1:
So if anyone searching how to do this in NUNIT3:
--where "cat == SmokeTests" --noresult
helped by @omer727 link!
回答2:
Link provided by @omer727 is broken, here is another one: https://github.com/nunit/docs/wiki/Console-Command-Line
The anwser still works:
--where "cat == SmokeTests"
The console command-line allows you to specify a filter, which will select which tests are executed. This is done using the --where option, followed by an expression in NUnit's Test Selection Language (TSL), a simple domain-specific language designed for this purpose.
Example:
nunit3-console mytest.dll --where "cat == Urgent || Priority == High"
For more details visit this link: https://github.com/nunit/docs/wiki/Test-Selection-Language
EDIT:
The detailed example can be found in the related SO question here.
回答3:
I'm using nUnit 3.4, and
--where "cat != blah"
did not work. I had to add colon
--where:"cat != blah"
Was running the command from powershell.
来源:https://stackoverflow.com/questions/34103853/nunit3-how-to-include-test-category-in-command-line