Command

Description

cpptestcov compute

Converts raw coverage input (.map, .clog) into coverage data files (.cov):

cpptestcov compute -map=<COV_MAP_ROOT_DIR> -clog=<COV_LOG_FILE> -out=<COV_DATA_DIR>

Use cpptestcov compute --help to list the supported options. 

Example: 

cpptestcov compute -map=.cpptest/cpptestcc -clog=cpptest_results.clog -out=cov-data-run1

cpptestcov index

Creates an index file (coverage.index) for a given coverage data folder:

cpptestcov index <COV_DATA_DIR>

Note: The coverage data folder needs to be indexed to present coverage data in Visual Studio Code. 

Example:

cpptestcov index cov-data-run1

cpptestcov merge

Merges multiple coverage data folders:

cpptestcov merge <COV_DATA_DIR_1_IN_OUT> <COV_DATA_DIR_2_IN> <COV_DATA_DIR_3_IN> ...

Be sure the <COV_DATA_DIR_1_IN_OUT> folder exists.

Example: 

cpptestcov merge cov-data-cumulative cov-data-run1 cov-data-run2

cpptestcov query

Computes coverage numerical values for coverage data folder:

cpptestcov query <COV_DATA_DIR> ...

Query type can be defined with the type parameter (percentage total covered suppressed notcovered). Coverable elements to be included in the query can be specified with the -element parameter (see -help for details). 

Example:

cpptestcov query -coverage LC cov-data-run1
cpptestcov query -coverage MCDC -type covered,total -element /home/project/file.cpp cov-data-run1

cpptestcov suppress

Applies coverage suppressions for a given coverage data folder:

cpptestcov suppress <COV_DATA_DIR>

Coverage suppressions should be added directly to the tested code - as a code comment:

// parasoft-cov-suppress "Reason for suppressing coverage for this line"

or provided with a regular expressions defining lines to be suppressed. See also: Suppressing Coverage.

Example:

cpptestcov suppress cov-data-run1

cpptestcov suppress --regex ".DEBUG." cov-data-run1

cpptestcov suppress --regex-cov-reason ".while(1)." DC "ignore decision coverage for while(1)" cov-data-run1


cpptestcov report cobertura

Prints Line Coverage statistics in Cobertura format:

cpptestcov report cobertura <COV_DATA_DIR>

Example:

cpptestcov report cobertura cov-data-run1 > cobertura.xml

cpptestcov report dtp

Publishes coverage and GoogleTest results to Parasoft DTP:

cpptestcov report dtp <COV_DATA_DIR> <GOOGLE_TEST_REPORT_XML>

Example:

cpptestcov report dtp -settings dtp.properties cov-data-run1 gtest-test1.xml gest-test2.xml

Be sure to configure DTP parameters using a settings file; see Publishing Reports to Parasoft DTP.

cpptestcov report html

Generates a coverage report in HTML format:

cpptestcov report html <COV_DATA_DIR>

Example:

cpptestcov report html cov-data-run1

To include source code with coverage annotations, use the code option. To generate a single page report with coverage statistics only, use the single-page option. See -help for a complete list of options.

Examples:

cpptestcov report html -code -out report/run1.html cov-data-run1

cpptestcov report html --single-page -out coverage-stats.html cov-data-run1


cpptestcov report json

Prints coverage data folder statistics in JSON format:

cpptestcov report json <COV_DATA_DIR>

Example:

cpptestcov report json cov-data-run1 > report.json

cpptestcov report lcov

Prints Line Coverage statistics in lcov format:

cpptestcov report lcov <COV_DATA_DIR>

Example:

cpptestcov report lcov cov-data-run1 > lcov.info

cpptestcov report markdown

Prints coverage data folder statistics in Markdown format:

cpptestcov report markdown <COV_DATA_DIR>

Example:

cpptestcov report markdown cov-data-run1 > report.md

cpptestcov report mcdc

Prints the MCDC truth-tables for a given coverage data folder:

cpptestcov report mcdc <COV_DATA_DIR>

Example:

cpptestcov report mcdc cov-data-run1

cpptestcov report suppressed-lines

Prints the lines with suppressed coverage for a given coverage data folder:

cpptestcov report suppressed-lines <COV_DATA_DIR>

Example: 

cpptestcov report suppressed-lines cov-data-run1

cpptestcov report suppressions

Prints the suppressed coverage elements for a given coverage data folder:

cpptestcov report suppressions <COV_DATA_DIR>

Example:

cpptestcov report suppressions cov-data-run1

cpptestcov report text

Prints coverage data folder statistics:

cpptestcov report text <COV_DATA_DIR>

Example:

cpptestcov report text cov-data-run1

cpptestcov report uncovered-lines

Prints the uncovered lines for a given coverage data folder:

cpptestcov report uncovered-lines <COV_DATA_DIR>

Example:

cpptestcov report uncovered-lines cov-data-run1
  • No labels