NCover Documentation

NCover Run

Description

The RUN command combines the functionality of both USE and SUMMARIZE to:

-- Collect coverage on the process specified in the command line.

-- Write the coverage data to the specified project.

-- Give each execution the specified build ID.

You can specify the project and build ID (either as arguments or environment variables) just as in the USE command, but now you can pass a command line for NCover to run (similar to the NCover 3 Console).

Usage

The token '--' marks the end of arguments that should be passed to NCover and the beginning of the command line to run.

NCover will run the specified command line and then print a summary, just like the SUMMARIZE command. You can fail a build with the --fail-build option to return an error code if any of the limits specified on the Threshold tab are not met for the specified project.

NCover Run --project="MyProject" --build-id="$(build-id)" -- nunit-console.exe mytests.dll 

This will run nunit-console.exe and place the coverage data into MyProject, giving the resulting execution the build ID $(build-id), which represents a build system variable. After the tests finish, a summary will be printed.

Example

NCover Run --project="NUnitLocal" --buildId="RDTest1" --working-dir="C:\Users\Russell\Desktop\NUnit" --summarize -- "C:\dev\NUnit 2.5.9\bin\net-2.0\nunit-console-x86.exe" "C:\Users\Russell\Documents\Visual Studio 2010\Projects\Calc\Debug\CalcTest.dll"

Options

  --project                 NCover project name.
  --build-id, --buildid     Specify the build identification label for this execution.             
  --fail-build              Return an error code if any of the thresholds fail.
  --summarize               Output coverage result summary to console.
  --reg, --reg-dlls         Register NCover profiler Dlls if needed.
  --working-dir             The working directory to use when executing the command line.
  --help                    This screen.

If you still need technical assistance, we can help:

Submit A Support Ticket