当我通过命令提示符运行opencover时,它生成一个xml,然后我运行报告生成器,它在正确的文件夹中创建html文档,但是当我强制构建时,这些不会发生,这是正确的方法吗?这是在我的ccnet.config
中设置的 <!-- Open Cover -->
<tasks>
<exec>
<executable>C:Program Files (x86)OpenCoverOpenCover.Console.exe</executable>
<buildargs>-target:"C:Program Files (x86)NUnit 2.6.2binnunit-console.exe" -register:user -targetargs:"/nologo /noshadow "C:UsersusernameDocumentsVisual Studio 2010ProjectsWebCrawlerMVCWebCrawlerMVC.TestsbinDebugWebCrawlerMVC.Tests.dll" -filter:+[WebCrawlerMVC]* -output:coverage.xml </buildargs>
</exec>
<!-- Report Generator -->
<exec>
<executeable>C:Program Files (x86)ReportGeneratorbinReportGenerator.exe</executeable>
<buildargs>-reports:"C:Program Files (x86)OpenCovercoverage.xml" -targetdir:"C:Program Files (x86)CruiseControl.NETserverWebCrawlerMVCArtifactsReports" -reporttypes:XML;HTML</buildargs>
</exec>
</tasks>
前段时间我创建了一个教程。你可以在这里找到:http://www.palmmedia.de/Blog/2012/9/27/cruisecontrol-net-integration-of-coverage-reports
我在你的配置中看到的唯一错误是,你把引号放在了错误的位置。使用
"-reports:C:Program Files (x86)OpenCovercoverage.xml"
代替
-reports:"C:Program Files (x86)OpenCovercoverage.xml"