The CruiseControl documentation page has most of the help you need.
But NCover has always been a tricky one. If that page worked, I wouldn’t be writing this piece here.
- A CruiseControl.Net (I use v1.0.1) build server running all green. And you better be TDDing that code too…J.
- NAnt I use this (v 0.85) to build my code.
- NCover I use version 1.3.3 since that’s the only one there that still works with VS2003. Pick up 1.5.x for VS 2005.
Once you have all that in place, it’s time to get this started. To run NCover we need to add a task to our build file. It differs from the one on the CCNet doc page in the placement of the quotation marks. I found my solution by watching the Nant Build log on the CCNet dashboard
<exec program="l:\tools\NCover\ncover.console.exe" commandline="/w AT_Bin\Debug /c "L:\Program Files\NUnit_227\bin\nunit-console.exe" TestBearings.dll" />
Save that one. Now move onto the ccnet.config file. Add this to the tasks block of your project element there. We need this so that code coverage report is merged to the Nant build output file.
That’s it. Save and start a build. Hopefully that’s a green. Click on the green build link on the Recent Builds tab. Click on NCover report. You should be seeing something like this.
Now to find out why I don’t have 100% coverage J
Just that you know it is possible, If you have a different stylesheet for NCover results, rename and replace the stylesheet named
with your own. Hit F5 to refresh your browser and you should see the new results. Here I have use the default xsl that comes with NCover – although the CCNet version is more to the point. The one I mentioned in my earlier post is the best. I got an unexpected console listing at the top … but no big deal.