This example uses C/C++test CT coverage plugin for CMake.
Go to
<INSTALL_DIR>/examples/CovApplication
- Create a build directory.
mkdir .build
- Configure and build the project with coverage enabled.
cd .build cmake -DCPPTEST_COVERAGE=ON -DCPPTEST_HOME=$PWD/../../.. .. make
- Execute the instrumented application.
./timer
- Generate coverage data files into
.coverage/lastrun
.make cpptestcov-compute
- Merge
.coverage/lastrun
into.coverage/cumulative
.make cpptestcov-merge
- Apply coverage suppressions for
.coverage/cumulative
.make cpptestcov-suppress
- Report coverage statistics for
.coverage/cumulative
.make cpptestcov-report
See <INSTALL_DIR>/integration/cmake/cpptest-coverage.cmake
for more details.