This example uses C/C++test CT coverage plugin for CMake.

  1. Go to <INSTALL_DIR>/examples/CovApplication

  2. Create a build directory.
    mkdir .build
  3. Configure and build the project with coverage enabled.
    cd .build
    cmake -DCPPTEST_COVERAGE=ON -DCPPTEST_HOME=$PWD/../../.. .. 
    make
  4. Execute the instrumented application.
    ./timer
  5. Generate coverage data files into .coverage/lastrun.  
    make cpptestcov-compute
  6. Merge .coverage/lastrun into .coverage/cumulative
    make cpptestcov-merge
  7. Apply coverage suppressions for .coverage/cumulative
    make cpptestcov-suppress
  8. Report coverage statistics for .coverage/cumulative.  
    make cpptestcov-report

See <INSTALL_DIR>/integration/cmake/cpptest-coverage.cmake for more details.