使用 Nunit3-console.exe 在命名空间中运行所有测试 [英] Run all tests in namespace using Nunit3-console.exe
问题描述
在阅读关于 测试选择语言 的 NUnit 3 文档之后尝试了几种组合,我仍然无法弄清楚如何在特定命名空间内运行所有测试.
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.
最明显的尝试是:
nunit3-console.exe --where "test == 'MyNamespace.Subnamespace'" Tests.dll
不幸的是,这报告了零匹配测试,尽管使用 --explore
选项我可以在该命名空间中看到许多测试.
Unfortunately, this reports zero matching tests, although using the --explore
options I can see many tests within that namespace.
我是否需要使用正则表达式/通配符来完成此操作?NUnit 文档另有提示,但鉴于这行不通,我可能会这样做.
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.
推荐答案
似乎有以下效果:
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.
这篇关于使用 Nunit3-console.exe 在命名空间中运行所有测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!