我正在使用 OpenCoverhttp://nuget.org/packages/opencover并编写了以下批处理文件来运行单元测试并生成代码覆盖率统计信息:
echo off
echo ***************************
echo *** Running NUnit tests ***
echo ***************************
"..\packages\OpenCover.4.0.804\OpenCover.Console.exe" -register:user -target:"..\NUnit 2.6\bin\nunit-console-x86.exe" -targetargs:"..\Web.UnitTests\bin\Debug\Web.UnitTests.dll" -output:coverage.xml
echo **************************************
echo *** Generating coverage statistics ***
echo **************************************
"..\packages\ReportGenerator.1.6.0.0\ReportGenerator.exe" "-reports:coverage.xml" "-targetdir:%CD%"
echo ***********************************
echo *** Launching Internet Explorer ***
echo ***********************************
start "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "%CD%\Index.htm"
pause
但是,当我运行批处理文件时,出现错误:
Committing...
No results - no assemblies that matched the supplied filter were instrumented
this could be due to missing PDBs for the assemblies that match the filter
please review the output file and refer to the Usage guide (Usage.rtf)
很确定我做了一些愚蠢的事情/遗漏了一些明显的事情,但不确定是什么!
PDB 文件位于文件夹:“..\Web.UnitTests\bin\Debug\”
感谢任何帮助,
Thanks,
找到了解决方案,我缺少 nunit 的 /noshadow 开关。 IE。目标参数应该是:
-targetargs:"..\Web.UnitTests\bin\Debug\Web.UnitTests.dll /noshadow"
现在工作完美。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)