in

ASP.NET Weblogs

Hsue-Shen Tham

shen's rants on .NET

NCover - coverage tool

Been getting my hands dirty on doing a demo of agile .NET tools and one of the interesting tools that I've looked at is a coverage tool called NCover. First surprise .. doing a quick google search on ncover, I managed to find two version of NCover!! Both is similar products and with the same name! Great, now which one should I go for? Downloaded the first version, which is a NAnt task plugin and I thought to myself excellent, this will just integrates nicely into my NAnt build. After 20 minutes of playing around with it, I figured out it doesn't work as well as I thought it would. Tried the second one next, which is a pretty neat command line tool and freely available on gotdotnet. 

It works sweetly this time and how it works is by performing injection of coverage instrumentation codes into the assembly at run time and run the test to check for coverage metrics. Well at least this time it works and generated a report in xml for me. To view the xml report in a nicer format, you can either run xslt on it with the stylesheet that came together with the distribution or download the VS plugin tool that allows you to view it in VS. Personally, I did the whole process as a nant target. Run an exec task on the ncover and then transform it using style task.

Comments

 

Chris D said:

You indicated that you were able to run ncover as an exec task. When I try this, I get a "System.UnauthorizedAccessException: Access to the path is denied" method at some random spot that does a Console.WriteLine(). I was just wondering if you ran into these problems and if you overcame them.

FYI, I am running nant 0.84, GotDotNet NCover 1.2.2, and nunit 2.1.
March 30, 2004 12:18 PM
 

shen said:

Hi Chris,

Honestly, never seen that particular problem before. Thought might be helpful, here's my exec task for nant :

<exec program="ncover" commandline='/c "nunit-console ${nant.project.basedir}\${COMPILE_OUTPUT_PATH}"' />
March 30, 2004 8:51 PM
 

TrackBack said:

^_^,Pretty Good!
April 9, 2005 1:14 PM

Leave a Comment

(required)  
(optional)
(required)  
Add