NAnt Integration

<ncoverreport> task

Generates a html report on the test coverage of the specified code.
This task should be called once the tests are run.

To load the task add in this line to your initialisation target in your NAnt build file: <loadtasks assembly="NCover.dll" />

Attribute Type Description Required
reportname string File to output the coverage report. The default is Project.BaseDirectory/CoverageReport.html. False
actuals path(s) When tests are run against the instrumented code they append to in the current directory a file called 'actual.xml'. You need to specify the location of that file here. If several test suites are run from different directories, then list all the paths seperated by a ';'. True
minimumPercentage decimal The minimun percentage test coverage acceptable for a successfull build. Warning messages will be issued if code coverage gets within 10% of the minimum. If this happens it's time to write more tests (though shouldn't you be writing them before the code? ;-) False
history string The filename to store the coverage report's change over time. This should not be wiped on every build. Please note history is a new feature, the use of this feature will improve with time. History is disabled if no filename is present. False

Nested Elements:

None.

Example

The following example will create the report in the bulid directory called 'ProjectName-report.html':-
<target name="coverage-report" depends="nunit-tests" >
	<ncoverreport/>
</target>