The following options are available:

-compiler <name|path>

Specifies compiler configuration name to be used for code analysis and instrumentation. Compiler configuration name needs to be one of the supported compilers names. See Supported Compilers or use the -listcompilers option.

Configuration file format: cpptestcc.compiler <name>

Examples:

  • cpptestcc -compiler gcc_3_4 
  • cpptestcc -compiler vc_11_0 

-listcompilers

Prints out all the names of supported compiler configurations.

Configuration file format: cpptestcc.listCompilers

-include <file|pattern> and -exclude <file|pattern>

Includes/excludes file(s) that match the specified pattern into/from instrumentation scope. The options can be specified multiple times.

Final filtering is determined only after all include/exclude entries have been specified in the order of their specification.

The following wildcards are supported:

  • ? - Any character
  • * - Any sequence of characters

To prevent shells from expanding * wildcards to the list of files or directories, you can use the regex: prefix to specify the value.

Configuration file format: cpptestcc.include <path|pattern>

Example 1:

Assume the following project layout:
<project root>
+ external_libs
+ src
+ include

The following cpptestcc command will cause all the files from the external_libs directory to be excluded from instrumentation scope:
cpptestcc -include regex:*/<project root>/* -exclude regex:*/<project root>/external_libs <remaining part of cmd>

Example 2:

Assume the following project:
<project root>
<sourcefiles>.cpp
<headerfiles>.hpp

The following command line will instrument only header files without instrumenting source files:
cpptestcc -include regex:* -exclude regex:*.cpp <remaining part of cmd>

-ignore <pattern>

Ignores all source files matching specified <pattern> during processing. The option can be specified multiple times.

Files matching the specified pattern will not be parsed or instrumented, but they will be compiled in their original form.

The following wildcards are supported:

  • ? - Any character
  • * - Any sequence of characters

To prevent shells from expanding * wildcards to the list of files or directories, you can use the regex: prefix to specify the value.


Configuration file format: cpptestcc.ignore <path|pattern>

Use this option to reduce build time overhead by ignoring coverage analysis on some sections of the code (e.g., external libraries) or to ignore specific file that exposes problems during processing (e.g., parse error).

Example:

cpptestcc -ignore "*/Lib/*" <remaining part of cmd>
cpptestcc -ignore regex:*/file.c <remaining part of cmd>
cpptestcc -ignore c:/proj/file.c <remaining part of cmd>
cpptestcc -ignore "*/MyLib/*.cpp" -ignore file.cpp <remaining part of cmd>

Choosing between -ignore and -include/-exclude

In some cases, the -ignore option may appear to overlap with the -include/-exclude options. The difference is that the -ignore option completely removes the specified file from processing so that it is not parsed by coverage engine, whereas the -include/-exclude filters are applied after source code is parsed, which allows you to selectively instrument or not instrument header files. 

-line-coverage

Enables line coverage metric.

Runtime coverage results are written to the results log as the code is executed. This imposes some overhead on the tested code execution time, it but assures that coverage data is collected even if the application crashes. This option can not be used with -optimized-line-coverage.

Configuration file format: cpptestcc.lineCoverage

-optimized-line-coverage

Enables optimized line coverage data.

Runtime coverage results are stored in memory and written to the results log either after the application finishes or on user request. This results in better performance, but results may be lost if the application crashes. This option can not be used with -line-coverage.

Configuration file format: cpptestcc.optimizedLineCoverage

-workspace <path>

Specifies the workspace directory to be used during code analysis and instrumentation.

The workspace location is used to store important code structure information essential for generating the final coverage report. The workspace location must be the same for cpptestcc and cpptestcli. tool invocation.

Configuration file format: cpptestcc.workspace <path>

-psrc <file>

Specifies the configuration file with additional options for cpptestcc tool.

By default, cpptestcc attempts to read the .psrc file located in either the current working directory or in user HOME directory. Use -psrc to specify options inside the configuration file.

Configuration file format: pscom.psrc <file>

-help

Prints out help message and exits.

Configuration file format: cpptestcc.help

  • No labels