C/C++test CT supports the following code coverage metrics:

Follow the procedure below to collect code coverage.

  1. Instrument and build your code with the cpptestcc coverage tool; see Collecting Code Coverage for more details on cpptestcc.
    .map files will be created.
  2. Execute the instrumented application.
    A .clog file will be created.
  3. Generate coverage data files using cpptestcov compute:  
    cpptestcov compute -map=.cpptest/cpptestcc -clog=cpptest_results.clog -out=cov-data-run1
  4. Report coverage statistics using cpptestcov report text.
    cpptestcov report text cov-data-run1

The basic workflow can be further extended with the following steps:

See Tools and Commands Reference for details on these commands.