Wed, Mar 2 2005 9:59 PM Rob van der Meijden

Choosing between Ncover and Ncover

A little challenge for you, what wrong with the title … ready … absolutely nothing. There are currently two open source products which ‘cover’ the same functionality and obviously have the same name … Ncover.

I wanted to use a code coverage tool integrated in the daily build process. The build process was created with the use of Nant, Nunit and CruiseControl.Net. Both versions of Ncover can be used with these tools.

The first Ncover tool has been moved from GotDotNet to www.ncover.org (latest release dec 2004). This version has no integration with Nant, but has a command line interface which can be used along with the Exec task from Nant to implement a code coverage in the daily build. 

The second Ncover tool you can download at sourceforce (latest release jun 2004) This version integrates with Nant by using its own tasks. You’ll need 4 tasks to get the coverage of you’re tests. The creepy thing about this tool is that the ncover task has to ‘instrument’ you’re code to create some helpers for the coverage process.

Based on the ‘instrument’ issue I started with the first (www.ncover.org) Ncover tool. For each Nunit project within our solution I have created an Exec task to get a coverage of the code. Example: 

         commandline='/c "nunit-console.exe" "Project.nunit /xml=nunit-results.xml

            /out=nunit-results.output /nologo"

            /a AssemblyA;AssemblyB /o ncover-results.xml /l ncover.log'/> 

You can parse the results with the standard coverage.xsl or with this alternative and it give’s you the coverage of the nunit tests within you’re solution. And of course we all have the following results:  

 

 

See also a great tutorial for Ncover starters.

Filed under:

# re: Choosing between Ncover and Ncover

Monday, March 07, 2005 12:36 PM by Rob van der Meijden

For those using the "solution build task" with NAnt the NCover doesn't by default work since you need a reference to the NCover.dll which is hard to do in your project file since you don't want to clutter production code with unneeded references.
But I've made a little modification to the source of NCover (the one that builds with NAnt) to make this possible by adding another task type which will open the project file and actually add up the reference into the project file.

Also I've reformatted the xslt transformation to become way better.

Plus ome other minor modifications...

For those interested email me at thomas@frostinnovation.no
(MARK!
_ .NO _ NOT .com!! )

Thomas

# re: Choosing between Ncover and Ncover

Wednesday, June 15, 2005 7:08 PM by Rob van der Meijden

Looks like the link to the tutorial has changed. Try http://blog.dotnetwiki.org/PermaLink,guid,b7f1e308-066c-4c40-ab93-6872906e53b8.aspx

Also, the wiki has heaps of NCover information. Try this search of the site http://blog.dotnetwiki.org/SearchView.aspx?q=ncover

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Please add 4 and 8 and type the answer here: