问题
After pouring over the NUnit 3 documentation on Test Selection Language and trying a few combinations, I still cannot figure out how to run all the tests within a specific namespace.
The most obvious attempt being:
nunit3-console.exe --where "test == 'MyNamespace.Subnamespace'" Tests.dll
Unfortunately, this reports zero matching tests, although using the --explore
options I can see many tests within that namespace.
Do I need to use regular expression/wildcards to accomplish this? The NUnit docs hint otherwise, but given this doesn't work maybe I do.
回答1:
It seems the following works:
nunit3-console.exe --where "test =~ 'MyNamespace.Subnamespace'" Tests.dll
Note the squiggle =~
is a regex operator.
This is a bit of a surprise because the only example mentioning namespaces in the documentation uses the ==
syntax which, given my original experimentation, would not have any effect.
来源:https://stackoverflow.com/questions/40010519/run-all-tests-in-namespace-using-nunit3-console-exe