Visual Studio 2017 是否有可用的开盖工具或扩展?
Are there any open cover tools or extensions available for Visual Studio 2017?
我试图使用以下命令提取我的应用程序的覆盖率报告
OpenCover.Console.exe ^
-register:user ^
-target:"mstest.exe" ^
-targetargs:"/testcontainer:\"C:\myapp\bin\myapp.dll\" /resultsfile:\"myapp.trx\"" ^
-filter:"+[myapp*]* -[myapp.Test]* -[*]myapp.RouteConfig" ^
-mergebyhash ^
-skipautoprops ^
-output:"myapp.xml"
然后报告
.\ReportGenerator.exe ^
-reports:"F:\OpenCover\myapp.xml" ^
-targetdir:"ReportGenerator"
但是 运行 打开封面时出现以下错误?
我的命令有什么问题吗?
PS: 我已经注册了开盖profiler
我使用的是 mstest.exe 而不是 vstest.console for running test cases in open cover
这是使用 open-cover 提取覆盖率报告的批处理文件代码片段。
::Note:Before running this file, make sure opencover and reportgenerator installed in your system
::Download and read about opencover : https://github.com/OpenCover/opencover
::You can read about vstest.console command line documentation here https://msdn.microsoft.com/en-us/library/ms182486.aspx
::Set your project and report location's base path here
SET basePath=C:\MyProject
SET targetReportDir=F:\MyProject
SET targetHtmlReportDir=F:\MyProject\ReportGenerator
::Replace your test project Dll's path here
SET unitTestDlls=%basePath%\Demo.BusinessData\bin\Debug\Demo.BusinessData.Test.dll %basePath%\Demo.Cache.Test\bin\Debug\Demo.Cache.Test.dll
echo Test cases are running...
OpenCover.Console.exe -register:user -target:"vstest.console.exe" -targetargs:"%unitTestDlls%" -filter:"+[Demo*]* -[Demo*Test]* -[Demo*Test.Core]* -[Demo*Tests]*" -output:%targetReportDir%\DemoFullReport.xml -mergebyhash
echo Coverage report is preparing and will be saved to %targetHtmlReportDir%\Demo location
ReportGenerator.exe -reports:"%targetReportDir%\DemoFullReport.xml" -targetdir:"%targetHtmlReportDir%\Demo"
运行创建此批处理文件
之前要检查的要点
- 确保 vstest.console 环境已设置或 运行 在 visual studio 命令行中。
- 确保您的 opencover 已设置并可通过命令行访问。
- 确保 opencover 报告生成器已设置并可通过命令行访问。
谢谢
我试图使用以下命令提取我的应用程序的覆盖率报告
OpenCover.Console.exe ^
-register:user ^
-target:"mstest.exe" ^
-targetargs:"/testcontainer:\"C:\myapp\bin\myapp.dll\" /resultsfile:\"myapp.trx\"" ^
-filter:"+[myapp*]* -[myapp.Test]* -[*]myapp.RouteConfig" ^
-mergebyhash ^
-skipautoprops ^
-output:"myapp.xml"
然后报告
.\ReportGenerator.exe ^
-reports:"F:\OpenCover\myapp.xml" ^
-targetdir:"ReportGenerator"
但是 运行 打开封面时出现以下错误?
我的命令有什么问题吗?
PS: 我已经注册了开盖profiler
我使用的是 mstest.exe 而不是 vstest.console for running test cases in open cover
这是使用 open-cover 提取覆盖率报告的批处理文件代码片段。
::Note:Before running this file, make sure opencover and reportgenerator installed in your system
::Download and read about opencover : https://github.com/OpenCover/opencover
::You can read about vstest.console command line documentation here https://msdn.microsoft.com/en-us/library/ms182486.aspx
::Set your project and report location's base path here
SET basePath=C:\MyProject
SET targetReportDir=F:\MyProject
SET targetHtmlReportDir=F:\MyProject\ReportGenerator
::Replace your test project Dll's path here
SET unitTestDlls=%basePath%\Demo.BusinessData\bin\Debug\Demo.BusinessData.Test.dll %basePath%\Demo.Cache.Test\bin\Debug\Demo.Cache.Test.dll
echo Test cases are running...
OpenCover.Console.exe -register:user -target:"vstest.console.exe" -targetargs:"%unitTestDlls%" -filter:"+[Demo*]* -[Demo*Test]* -[Demo*Test.Core]* -[Demo*Tests]*" -output:%targetReportDir%\DemoFullReport.xml -mergebyhash
echo Coverage report is preparing and will be saved to %targetHtmlReportDir%\Demo location
ReportGenerator.exe -reports:"%targetReportDir%\DemoFullReport.xml" -targetdir:"%targetHtmlReportDir%\Demo"
运行创建此批处理文件
之前要检查的要点- 确保 vstest.console 环境已设置或 运行 在 visual studio 命令行中。
- 确保您的 opencover 已设置并可通过命令行访问。
- 确保 opencover 报告生成器已设置并可通过命令行访问。
谢谢