This page last changed on Aug 31, 2005 by mroberts.

This page shows how you can integrate NCover, a code coverage tool, with NUnit into your CruiseControl .NET build for test coverage purpose. NCover is a code coverage analysis tool and it is designed to work with compiled shipping code.

There are several different NCover projects available. We assume that you are using NCover.org version.

Run NCover as part of your integration

Run NCover as part of your NAnt build

In order to get the results of NCover included in the CruiseControl.NET build results, you will need to include a call to NCover in your NAnt build file. We recommend you use a NAnt fragment like this:

<exec 
    program="tools\ncover\ncover.exe" 
    workingdir="build\unittests" 
    commandline="/c &quot;..\..\tools\nunit\nunit-console.exe MyUnitTests.dll /xml:../MyUnitTests.dll-results.xml /nologo&quot;"/>

For a thorough example, look at the CruiseControl.NET source distribution and look at how we use NCover ourselves.

Run NCover as a CruiseControl.NET Task

We don't currently support running NCover directly from CruiseControl.NET, but we plan on enabling this in a later release.

Merge NCover results into your CruiseControl.NET results

The next step is to merge the NCover report file into the integration result using the File Merge Task. Your CruiseControl.NET Server config file will have something in it like :

<tasks>
    <merge>
        <files>
            <file>d:\sourceforge\ccnet\build\unittests\Coverage.xml</file>
            <!-- Other files to merge for your build would also be included here -->
      	</files>
    </merge>
</tasks>

Configuring your Reporting Application to display NCover results

For displaying the results, CruiseControl.NET currently supports NCover 1.3.3.

If you are using the Web Dashboard, edit your web.config file and include the ThoughtWorks.CruiseControl.WebDashboard.Plugins.NCover.NCoverReportBuildPlugin Build Plugin.

If you are using Project Report Web Application, edit your web.config file and include the Coverage.aspx Build Plugin.

Document generated by Confluence on Jan 23, 2011 08:52