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

AOCL User Guide (57404)

Document_ID
57404
Release_Date
2026-05-13
Version
5.3 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