Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To customize collecting coverage with the C/C++test CT extension, open the cpptest-coverage.cmake file you copied to your CMake project and modify the C/C++test CT options.

Option NameDescription

Default

CPPTEST_COMPILER_ID

Specifies the compiler configuration that matches your compiler.

gcc_10-64
CPPTEST_COVERAGE_TYPE_INSTRUMENTATIONSpecifies the coverage types to be enabled for code instrumentation. See Command Line Reference for cpptestcc for available options.-line-coverage -statement-coverage -block-coverage -decision-coverage -simple-condition-coverage -mcdc-coverage -function-coverage -call-coverage
CPPTEST_COVERAGE_TYPE_REPORTSpecifies the coverage types to be enabled for report generation.LC,SC,BC,DC,SCC,MCDC,FC,CC
CPPTEST_COVERAGE_WORKSPACESpecifies the path to the workspace for the coverage tool where C/C++test's coverage data files are stored by default.<CMAKE_BINARY_DIR>/cpptest-coverage/<CMAKE_PROJECT_NAME>
CPPTEST_COVERAGE_LOG_FILE

Specifies the name and location of the C/C++test coverage log file (.clog).

Important: You must ensure the coverage log directory exists before running the instrumented application.

<CPPTEST_COVERAGE_WORKSPACE>/<CMAKE_PROJECT_NAME>.clog
CPPTEST_CPPTESTCC_OPTSSpecifies the options for the cpptestcc coverage tool.

Example of Integrating the Coverage Extension with CMake Project

...