TeamCity 5.0 Help

NCover

TeamCity supports code coverage with NCover (1.x and 3.x) for NUnit tests run via TeamCity NUnit test runner, which can be configured in one of the following ways: web UI, TeamCity NUnit Test Launcher, NUnit for MSBuild, NUnit for MSBuild, NUnit for NAnt Build Runner.

Configuring NCover 1.x

Make sure your NUnit tests run under x86.

To configure NCover 1.x:

  1. While creating/editing Build Configuration, go to the Build Runner page.

  2. Select MSBuild, Visual Studio(sln) or NAnt build runner.

  3. Select NCover (1.x) in .NET coverage tool.

  4. Set up the NCover options - find the description of the available options below.

Option

Description

Path to NCover

Specify the path to NCover installed on a build agent, or use %\system.ncover.v1.path% to refer to auto-detected NCover on a build agent.

Path to NCoverExplorer

Specify the path to NCoverExplorer on the build agent.

Additional NCover Arguments

Type additional arguments to be passed to NCover.

Assemblies to Profile

Specify assembly names (without paths and extensions) separated with new line, or leave this field blank to profile all assemblies. Equivalent to //a NCover.Console option.

Exclude Attributes

Specify the classes and methods with defined .NET attribute(s) to be excluded from coverage statistics. Equivalent to //ea NCover.Console option

Report Type

Select the report type. For the details, refer to NCoverExplorer documentation.

Sorting

Select the preferred sorting option. For the details, refer to NCoverExplorer documentation.

Additional NCoverExplorer Arguments

Specify additional arguments to be passed to NCoverExplorer. Do not enter here the output path for the reports, nor specify arguments, for which there are corresponding options in the UI.

Configuring NCover 3.x

Make sure, you use have specified the same platform both for NCover and NUnit.

To configure NCover 3.x:

  1. While creating/editing Build Configuration, go to the Build Runner page.

  2. Select MSBuild, Visual Studio(sln) or NAnt build runner.

  3. Select NCover (3.x) as a .NET coverage tool.

  4. Set up the NCover options - find the description of the available options below.

Option

Description

Path to NCover 3

Specify the path to NCover installation folder. Alternatively use %\system.ncover.v3.x86.path% or %\system.ncover.v3.x64.path% to refer to auto-detected NCover 3 on a build agent.

Run NCover under

Select the preferred platform to run coverage under - x86 or x64. Make sure the selected platform agrees with the one used for NUnit tests.

NCover Arguments

Specify NCover arguments, i.e. assemblies to profile and coverage tool specific arguments. Do not enter here arguments, which can be specified in the UI, nor enter here output path for generated reports and NCover process parameters. Use //ias .* to get coverage of all assemblies.

NCover Reporting Arguments

Specify additional NCover reporting arguments, except for the output path. Use //or FullCoverageReport:Html:{teamcity.report.path} to get a report.

Last modified: 20 April 2023