10.1.7. Running source code coverage using GCOV - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

Prerequisites:

  • gcov

  • lcov

  • genhtml

To measure source code coverage, set CODE_COVERAGE=ON while configuring the CMake build.

Build with the custom target option ‘code-coverage’ to execute tests and generate code coverage data.

The code coverage reports are generated in the build directory’s ‘coverage/html_report’ subdirectory. Open the HTML files in a web browser to view the coverage information

Sample command to obtain code coverage report:

cmake --build <build directory> --target install code-coverage