This example uses C/C++test CT coverage plugin for Bazel.
- Move
<INSTALL_DIR>/integration/bazel/WORKSPACE.bazel
and<INSTALL_DIR>/integration/bazel/BUILD.bazel
into the C/C++test CT installation directory.
Note: Make sure the files are moved and no copy remains in theintegration/bazel
directory. - Go to
<INSTALL_DIR>/examples/CovApplication
- Build the project with coverage enabled.
bazel run --config=cpptest_coverage
- Execute the instrumented application.
bazel-bin/Timer.elf
- Generate coverage data files into
.coverage
.cpptestcov compute -map .cpptest -clog cpptest_results.clog -out .coverage
- Report coverage statistics for
.coverage
.cpptestcov report text .coverage
See <INSTALL_DIR>/integration/bazel/README.txt
for more details.