具有.net核心3.1 Microsoft.net.sdk项目,并具有许多异步xUnit测试。
dotnet test Common\Common.csproj /p:CollectCoverage=true /
显示100%,但是创建了一个空的coverage文件dotnet test Common\Common.csproj --collect:"XPlat Code Coverage"
在testresults \ {guid} \ coverage.cobertura.xml中创建了一个文件-但它只是说lines-covered = 0而stdout表示88次测试在4秒钟内运行。我究竟做错了什么?
对我来说,coverlet.msbuild与命令完美结合: dotnet test Common\Common.csproj /p:CollectCoverage=true /p:IncludeTestAssembly=true /p:CoverletOutputFormat=cobertura /p:ExcludeByFile=\"**/Microsoft.NET.Test.Sdk.Program.cs\"
因此,我想您在这里错过了CoverletOutputFormat。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句