打开xunit.runner.utility.dotnet的封面运行覆盖率

时间:2017-06-26 18:50:36

标签: .net-core code-coverage opencover

无论我选择什么目标,Open Cover的输出始终显示来自(Coverage.xml)的程序集:

<ModulePath>C:\Users\XXX\.nuget\packages\xunit.runner.utility\2.2.0-beta2-build3300\lib\netstandard1.1\xunit.runner.utility.dotnet.dll</ModulePath>
<ModuleTime>2016-06-27T13:43:52Z</ModuleTime>
<ModuleName>xunit.runner.utility.dotnet</ModuleName>

我的批处理文件:

@echo off

SET dotnet="C:/Program Files/dotnet/dotnet.exe" 
SET opencover=C:\Users\XXX\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe

SET targetargs="test c:\SfmcAdapter\trunk\dotnet_core\sfmc_adapter\test\SFMC.Adapter.Service.Tests"  
SET filter="+[*]*"  
SET coveragefile=Coverage.xml  
SET coveragedir=Coverage

REM Run code coverage analysis  
%opencover% -oldStyle -register:user -target:%dotnet% -output:%coveragefile% -targetargs:%targetargs% -filter:%filter% -skipautoprops -hideskipped:All

我希望它能够获取我的程序集覆盖范围,而不是xunit程序集。

1 个答案:

答案 0 :(得分:3)

我弄明白了,请确保在project.json文件中将debugType设置为已满。然后我能够看到报道。以前这被设置为“便携式”。

 "debugType": "full"