Skip to content

Generating a code coverage report

Johannes Holke edited this page May 15, 2025 · 10 revisions

Currently, a code coverage report is generated only for the main branch during the nightly CI-run and deployed to Codecov. The current report can be found here. Additionally, a PR is removed from the merge queue if the code coverage would decrease due to the PR.

One can generate a code coverage report locally to determine if the current changes reduce the code coverage. You can follow these steps:

  1. Configure in Debug mode and with the test coverage option enabled. If you want to compare the result to the coverage report on github, you should set the test level to 1. You can execute the following command in the build folder:
cmake -DCMAKE_BUILD_TYPE=Debug -DT8CODE_CODE_COVERAGE=ON -DT8CODE_TEST_LEVEL=1 ..
  1. Perform the build step as usual, e.g., with
cmake -- build .
  1. You have to have lcov installed for this step. (On the Teamserver you may load the module lcov/lcov-1.15/lcov-1.15-gcc-9.4.0-eeschdm).

To generate the coverage report, use

cmake --build . --target coverage

This step can take a few minutes, depending on the test level.

  1. Find the html coverage report index.html in the folder coverage in the build directory.

Clone this wiki locally