我有一个 dotnetcore MSTest 项目,其中的测试按 TestCategory
属性分类。我希望能够通过任务从 VSCode 运行各种测试集。从命令行这有效:
dotnet test src\tests\tests.csproj --filter TestCategory!=Integration
但是有了这个任务定义:
{
"label": "ci tests","command": "dotnet","type": "process","isTestCommand": true,"args": [
"test","${workspaceFolder}\\src\\tests\\tests.csproj","--filter TestCategory!=Integration"
]
}
它失败了
> Executing task: C:\Program Files\dotnet\dotnet.exe test C:\project\src\tests\tests.csproj --filter TestCategory!=Integration <
MSBUILD : error MSB1001: Unknown switch.
Switch: --filter TestCategory!=Integration
For switch syntax,type "MSBuild -help"
在这种情况下将 --filter
正确传递给 dotnet
可执行文件的语法是什么?