在我的单元测试项目的构建后事件中,我运行OpenCover和ReportGenerator来获得代码覆盖率报告:
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命令,它将在我的默认浏览器中打开HTML。但是,如果报表可以在本身内打开,我希望这样做。
如果和如何做到这一点?
发布于 2014-09-23 09:10:55
很简单的一件事对我来说是很简单的-
start http://localhost/MYWeb/Home.aspx发布于 2013-11-28 08:41:37
您可能可以使用devenv使用命令行开关打开文件。
devenv /edit $(SolutionDir)TestResults\Coverage\index.htm但是它可以打开它作为一个文件编辑,而不是查看。
https://stackoverflow.com/questions/20252655
复制相似问题