Question

When I run opencover through the command prompt it generates a xml, then i run report generator and it creates the html documents in the correct folder, but when i force a build, these don't happen, is this the correct way to do it? this what's setup in my ccnet.config

  <!-- Open Cover -->
<tasks>
  <exec>
    <executable>C:\Program Files (x86)\OpenCover\OpenCover.Console.exe</executable>
    <buildargs>-target:"C:\Program Files (x86)\NUnit 2.6.2\bin\nunit-console.exe" -register:user -targetargs:"/nologo /noshadow \"C:\Users\username\Documents\Visual Studio 2010\Projects\WebCrawlerMVC\WebCrawlerMVC.Tests\bin\Debug\WebCrawlerMVC.Tests.dll" -filter:+[WebCrawlerMVC]* -output:coverage.xml </buildargs>
  </exec>
  <!-- Report Generator -->
  <exec>      
    <executeable>C:\Program Files (x86)\ReportGenerator\bin\ReportGenerator.exe</executeable>
    <buildargs>-reports:"C:\Program Files (x86)\OpenCover\coverage.xml" -targetdir:"C:\Program Files (x86)\CruiseControl.NET\server\WebCrawlerMVC\Artifacts\Reports" -reporttypes:XML;HTML</buildargs>
  </exec>
</tasks>
Was it helpful?

Solution

Some time ago I created a tutorial. You find it here: http://www.palmmedia.de/Blog/2012/9/27/cruisecontrol-net-integration-of-coverage-reports

The only mistake I can see in your configuration is, that you placed the quotes at the wrong position. Use

"-reports:C:\Program Files (x86)\OpenCover\coverage.xml"

instead of

-reports:"C:\Program Files (x86)\OpenCover\coverage.xml"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top