Introducing dotCover Console Runner
dotCover console runner is a console application included in the dotCover distribution package. The main tasks of this application are following:
- Control execution of any test runner (MSTest, NUnit, xUnit, MSpec, etc.) and record coverage of executed tests in coverage snapshots.
Merge coverage snapshots.
You may need to merge snapshots if, for example, you use several different formats of unit tests in your project or solution. In this case, you will have start console runner for all corresponding test runners and get several coverage snapshots. Use merge command to merge the snapshots.
Generate coverage reports in different formats.
Use report command to generate reports in desired formats from coverage snapshots.
To set up dotCover Console Runner on a server
- Open the dotCover | Remote Coverage options page.
- Click Get Server Package. dotCover will generate an archive with all necessary files.
- Copy the archive to the machine where you are going to set up the Console Runner.
- Extract files from the archive to a directory, from which you are going to start the Console Runner executable file (dotCover.exe).
Configuration of console runner is very simple and can be done via command line parameters or XML configuration files.
The example below illustrates usage of the
dotCover analyse config.xml
Where config.xml contains the necessary configuration parameters, e.g:
<?xml version="1.0" encoding="utf-8"?> <AnalyseParams> <TargetExecutable>D:\Program Files\NUnit 2.6\bin\nunit-console.exe</TargetExecutable> <TargetArguments>D:\Projects\TheApplication\bin\Debug\AppTests.dll</TargetArguments> <Output>AppCoverageReport.html</Output> <ReportType>html</ReportType> </AnalyseParams> <Filters> <ExcludeFilters> <FilterEntry> <ClassMask>IntegrationTests</ClassMask> </FilterEntry> </ExcludeFilters> </Filters>
A stub for the config file for each command could be generated automatically by typing
dotCover help analyse config.xml
in the command line. The sample config file would be created with comments indicating what each element means.
Besides test coverage reports, you can get a raw coverage snapshot by using the cover command. You can then open and analyze the snapshot in the standalone dotCover application or in the Visual Studio.
The only limitation of coverage snapshots obtained with the console runner is that they do not contain per-test coverage results, i.e, the following analysis features are unavailable: Viewing Total Coverage of Particular Unit Test Item and Navigation to Covering Tests.