在我的单元测试项目的生成后事件我跑OpenCover和ReportGenerator得到一个代码覆盖率报告:打开生成生成后事件HTML报告
del "$(SolutionDir)TestResults\Coverage\*.*"
"$(SolutionDir)packages\OpenCover.4.5.1923\OpenCover.Console.exe"
-register:user
-target:"$(MSBuildProgramFiles32)\Microsoft Visual Studio 12.0\
Common7\IDE\MSTest.exe"
-targetdir:"$(ProjectDir)bin\$(ConfigurationName)"
-targetargs:"/testcontainer:\"$(TargetPath)\""
-output:"$(SolutionDir)TestResults\Coverage\coverage.xml"
-filter:"+[MyProject]* "
$(SolutionDir)packages\ReportGenerator.1.9.1.0\ReportGenerator.exe"
-reports:"$(SolutionDir)TestResults\Coverage\coverage.xml"
-targetdir:"$(SolutionDir)TestResults\Coverage"
call "$(SolutionDir)TestResults\Coverage\index.htm"
的最后一步是打开生成的HTML报告。使用当前的call
命令,它将在我的默认Web浏览器中打开HTML报告。但是,如果报告可以在Visual Studio中打开,我希望它。
如果和我将如何实现这一目标?
你能解释一下你希望通过报告对外开放在Visual Studio中,而不是在浏览器中实现什么? –
真的很方便。当我构建我的项目并完成时,它将在同一个窗口中显示构建结果和覆盖率报告,而不是在VS和浏览器之间切换。 –