dotCover Web Help

dotCover Console Runner provides the following commands:

  • analyse - All-in-one task. Performs coverage analysis, generates report and removes snapshots.
  • cover - Perform coverage analysis of the specified application.
  • delete - Delete all files related to the specified snapshots.
  • help - Show console runner help.
  • list - Obtain list of all files related to the specified snapshots.
  • merge - Merge several coverage snapshots.
  • report - Create a report by the specified snapshot.
  • version - Write dotCover version info to the specified file.
  • zip - Compress coverage snapshot.

You can learn everything about each command right in the console by typing help followed by the command name. All commands (including help) have corresponding shortcuts. For instance, to get information about the analyse command, we can type:

dotCover.exe help analyse
or
dotCover.exe h a

Tip

It is possible to specify relative paths in the console runner parameters. Relative paths defined in an xml configuration file are treated relative to the location of this file. Relative paths in command line parameters are treated relative to the console runner working directory.

analyse

analyse: All-in-one task. Performs coverage analysis, generates report and removes snapshots.
usage: dotCover analyse [parameters]

Valid parameters:
  /TargetExecutable=ARG        : (Required) File name of the program to analyse
  /TargetArguments=ARG         : (Optional) Program arguments
  /TargetWorkingDir=ARG        : (Optional) Program working directory
  /TempDir=ARG                 : (Optional) Directory for the auxiliary files. Set to system temp by default
  /ReportType=ARG              : (Optional) [HTML|JSON|XML|NDependXML]. A type of the report. XML by default
  /Output=ARG                  : (Required) Resulting report file name
  /InheritConsole=ARG          : (Optional) [True|False] Lets the application being analysed to inherit dotCover console. True by default
                                 Please note that windows of analysed GUI application will not be hidden if console is inherited
  /AnalyseTargetArguments=ARG  : (Optional) [True|False] Specifies whether dotCover should analyse target arguments string
                                 and convert relative paths to absolute there. True by default
  /Filters=ARG                 : (Optional) Specify coverage filters using following syntax: +:module=*;class=*;function=*;
                                 Use -:myassembly to exclude an assembly from code coverage. Asterisk wildcard (*) is supported here
  /AttributeFilters=ARG        : (Optional) Specify attribute filters using following syntax: filter1;filter2;...
                                 Asterisk wildcard (*) is supported here
Global parameters:
  /LogFile=ARG                 : (Optional) Enables logging and specifies log file name

It is possible to specify part of the parameters or all of them in the configuration file.
usage: dotCover <configuration file name> [parameters]
Configuration file format:

  <AnalyseParams>
    <TargetExecutable><!-- File name of the program to analyse. --></TargetExecutable>
    <TargetArguments><!-- Program arguments. --></TargetArguments>
    <TargetWorkingDir><!-- Program working directory. --></TargetWorkingDir>
    <TempDir><!-- Directory for the auxiliary files. Set to system temp by default. --></TempDir>
    <Output><!-- Resulting report file name. --></Output>
    <ReportType><!-- [HTML|JSON|XML|NDependXML]. A type of the report. XML by default. --></ReportType>
    <InheritConsole><!-- [True|False] Lets the application being analysed to inherit dotCover console. True by default. --> </InheritConsole>

    <!-- Coverage filters. It's possible to use asterisks as wildcard symbols.
    <Filters>
      <IncludeFilters>
        <FilterEntry>
          <ModuleMask> Module mask. </ModuleMask>
          <ClassMask> Class mask. </ClassMask>
          <FunctionMask> Function mask. </FunctionMask>
        </FilterEntry>
      </IncludeFilters>
      <ExcludeFilters>
        <FilterEntry>...</FilterEntry>
        <FilterEntry>...</FilterEntry>
        <FilterEntry>...</FilterEntry>
      </ExcludeFilters>
    </Filters>
    -->
    <!-- Attribute filters. It's possible to use asterisks as wildcard symbols.
    <AttributeFilters>
      <AttributeFilterEntry>...</AttributeFilterEntry>
      <AttributeFilterEntry>...</AttributeFilterEntry>
    </AttributeFilters>
    -->
  </AnalyseParams>
                 

cover

cover: Perform coverage analysis of the specified application.
usage: dotCover cover [parameters]

Valid parameters:
  /TargetExecutable=ARG        : (Required) File name of the program to analyse
  /TargetArguments=ARG         : (Optional) Program arguments
  /TargetWorkingDir=ARG        : (Optional) Program working directory
  /TempDir=ARG                 : (Optional) Directory for the auxiliary files. Set to system temp by default
  /Output=ARG                  : (Required) Path to the resulting coverage snapshot
  /InheritConsole=ARG          : (Optional) [True|False] Lets the application being analysed to inherit dotCover console. True by default
                                 Please note that windows of analysed GUI application will not be hidden if console is inherited
  /AnalyseTargetArguments=ARG  : (Optional) [True|False] Specifies whether dotCover should analyse target arguments string
                                 and convert relative paths to absolute there. True by default
  /Filters=ARG                 : (Optional) Specify coverage filters using following syntax: +:module=*;type=*;function=*;
                                 Use -:myassembly to exclude an assembly from code coverage. Asterisk wildcard (*) is supported here
  /AttributeFilters=ARG        : (Optional) Specify attribute filters using following syntax: attribute1;[module]attribute2;...
                                 Where 'module' - is optional name of the assembly where attribute is defined.
                                 Asterisk wildcard (*) is supported here
Global parameters:
  /LogFile=ARG                 : (Optional) Enables logging and specifies log file name

It is possible to specify part of the parameters or all of them in the configuration file.
usage: dotCover <configuration file name> [parameters]
Configuration file format:

  <CoverageParams>
    <TargetExecutable><!-- File name of the program to analyse. --></TargetExecutable>
    <TargetArguments><!-- Program arguments. --></TargetArguments>
    <TargetWorkingDir><!-- Program working directory. --></TargetWorkingDir>
    <TempDir><!-- Directory for the auxiliary files. Set to system temp by default. --></TempDir>
    <Output><!-- Path to the resulting coverage snapshot. --></Output>
    <InheritConsole><!-- Lets the application being analysed to inherit dotCover console. 'true' by default. --> </InheritConsole>

    <!-- Coverage filters. It's possible to use asterisks as wildcard symbols.
    <Filters>
      <IncludeFilters>
        <FilterEntry>
          <ModuleMask> Module mask. </ModuleMask>
          <ClassMask> Class mask. </ClassMask>
          <FunctionMask> Function mask. </FunctionMask>
        </FilterEntry>
      </IncludeFilters>
      <ExcludeFilters>
        <FilterEntry>...</FilterEntry>
        <FilterEntry>...</FilterEntry>
        <FilterEntry>...</FilterEntry>
      </ExcludeFilters>
    </Filters>
    -->
    <!-- Attribute filters. It's possible to use asterisks as wildcard symbols.
    <AttributeFilters>
      <AttributeFilterEntry> Attribute mask </AttributeFilterEntry>
      <AttributeFilterEntry>
        <ModuleMask> Module mask </ModuleMask>
        <ClassMask> Class mask </ClassMask>
      </AttributeFilterEntry>
    </AttributeFilters>
    -->
  </CoverageParams>
 

Note

Format of coverage filters specified from the console are compatible with format of filters defined in JetBrains TeamCity.

delete

delete: Delete all files related to the specified snapshots.
usage: dotCover delete <configuration file>

Valid options:
  /Source=ARG      : List of snapshot files separated with semicolon (;)

Global options:
  /LogFile=ARG     : Enables logging and specifies log file name

Configuration file format:

<DeleteParams>
  <Source><!-- Required. At least one child element expected. -->
    <string><!-- Source file 1 --></string>
    <string><!-- Source file 2 --></string>
    <string><!-- Source file N --></string>
  </Source>
</DeleteParams>
                 

help

help: Show console runner help.
usage: dotCover help <command>
usage: dotCover help <command> <file name>
                 

list

list: Obtain list of all files related to the specified snapshots.
usage: dotCover list <configuration file>

Valid options:
  /Source=ARG     : List of snapshot files separated with semicolon (;)
  /Output=ARG     : Resulting file name. Stores plain list of all snapshot files.

Global options:
  /LogFile=ARG    : Enables logging and specifies log file name

Configuration file format:

<ListParams>
  <Source><!-- Required. At least one child element expected. -->
    <string><!-- Source file 1 --></string>
    <string><!-- Source file 2 --></string>
    <string><!-- Source file N --></string>
  </Source>
  <Output><!-- Required. Resulting file name. Stores plain list of all snapshot files. --></Output>
</ListParams>
                 

merge

merge: Merge several coverage snapshots.
usage: dotCover merge <configuration file>

Valid options:
  /Source=ARG     : List of snapshots separated with semicolon (;)
  /Output=ARG     : File name for the merged snapshot
  /TempDir=ARG    : Directory for the auxiliary files. Set to system temp by default

Global options:
  /LogFile=ARG    : Enables logging and specifies log file name

Configuration file format:

<MergeParams>
  <Source> <!-- Required. At least one child element expected. -->
    <string><!-- Source file 1 --></string>
    <string><!-- Source file 2 --></string>
    <string><!-- Source file N --></string>
  </Source>
  <TempDir><!-- Optional. Directory for the auxiliary files. Set to system temp by default. --></TempDir>
  <Output><!-- Required. File name for the merged snapshot. --></Output>
</MergeParams>
             

report

report: Create a report by the specified snapshot.
usage: dotCover report <configuration file>

Valid options:
  /Source=ARG            : Coverage snapshot file name
  /Output=ARG            : Resulting report file name
  /ReportType=ARG        : [HTML|JSON|XML|NDependXML]. A type of the report. XML by default

Global options:
  /LogFile=ARG           : Enables logging and specifies log file name

Configuration file format:

<ReportParams>
  <Source><!-- Required. Coverage snapshot file name. --></Source>
  <Output><!-- Required. Resulting report file name. --></Output>
  <ReportType><!-- Optional [HTML|JSON|XML|NDependXML]. A type of the report. XML by default. --></ReportType>
</ReportParams>
                 

version

version: Write dotCover version info to the specified file.
usage: dotCover version <output file name>

Global options:
  /LogFile=ARG    : Enables logging and specifies log file name
                 

zip

zip: Compress coverage snapshot.
usage: dotCover zip <configuration file>

Valid options:
  /Source=ARG    : Coverage snapshot file name
  /Output=ARG    : Zipped snapshot file name

Global options:
  /LogFile=ARG   : Enables logging and specifies log file name

<ZipParams>
  <Source><!-- Required. Coverage snapshot file name. --></Source>
  <Output><!-- Required. Zipped snapshot file name. --></Output>
</ZipParams>