如何在 VSCode 任务中使用 MSTest --filter 参数

我有一个 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 可执行文件的语法是什么?

love14521 回答:如何在 VSCode 任务中使用 MSTest --filter 参数

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/6878.html

大家都在问