Andrew Stopford's Weblog

poobah

Sponsors

News

Articles

Family

Old Blogs

Code coverage any success?

When I last tried code coverage tools I was unable to get NCover or CoverageEye.net to install. I retried the latest alpha drop of NCover tonight and its struggling with the NAnt soloution task. I think the problem may be what the soloution task is doing but they are locking each other up. I also tried the "other" NCover, the documention is confusing and the reporting nant task was refusing to look in the correct directories, in the end I gave up. So my question, has anyone actually done anything with code coverage? and are you using it with NAnt? are you using opensource tools or commerical tools? will the TS stuff really capture the market? Thoughts welcome.

Comments

Jonathan de Halleux said:

Did you try to launch NCover from NAnt as a command shell instruction?
# November 21, 2004 11:45 PM

TrackBack said:

# November 22, 2004 12:54 AM

Andrew Stopford said:

I did'nt use NAnt I tried this manually in the command shell. I am profiling a class lib so to do that I need to profile NUnit as it runs the unit tests on the lib. Interestingly it raises the error but clicking continue finishes the profile, however coverage data includes NUnit but not my lib.
# November 22, 2004 4:30 AM

Melvin Lee said:

I use the following commandline to execute ncover for my lib

"c:\Program Files\NCover\NC
over.Console.exe" /c "c:\Program Files\TestDriven.NET 1.0\MbUnit\MbUnit.Cons.exe" MyAssemblyToProfile.dll /a MyNamespaceToProfile /v

You have to run this command line in the debug directory since NCover requires the pdb files.

I use the following Nant script snippet to do code coverage in a automatic build

<property name="test.include.pattern" value="./Tests/**/bin/debug/*Tests.dll" />
<property name="ncover.executable" value="c:\Program Files\NCover\NCover.Console.exe" />
<property name="mbunit.executable" value="C:\Program Files\TestDriven.NET 1.0\MbUnit\mbunit.cons.exe" />

<target name="code-coverage">
<foreach property="assembly.name" item="File">
<in>
<items>
<include name="${test.include.pattern}" />
</items>
</in>
<do>
<property name="assembly.namespace" value="${string::replace(assembly::get-name(assembly.name), 'Tests', '')}" />
<exec program="${ncover.executable}" commandline="/c &quot;${mbunit.executable}&quot; ${assembly.name} /a ${assembly.namespace} /w ${path::get-directory-name(assembly.name)} /v" />
</do>
</foreach>
</target>
# November 22, 2004 8:45 AM

Howard van Rooijen said:

# November 22, 2004 10:36 AM

TrackBack said:

# November 24, 2004 2:20 PM

TrackBack said:

# November 25, 2004 12:05 AM