1 .. _lcov_code_coverage:
3 Code coverage with lcov
4 =======================
9 Ensure required packages are installed:
15 The Linux gcov and lcov tools can be fussy about gcc / g++ compiler
16 versions. As of this writing, Ubuntu 22.04 gcov / lcov works with
17 the latest gcc version (``11.3.0``).
19 Generate coverage for a test case
20 ---------------------------------
22 As a first run, in order to generate the coverage report of
23 a specific plugin or test, run for example
27 $ make test-cov TEST=fib
29 Then open the file ``.build-root/test-coverage/html/index.html`` in a Chrome browser.
31 Improving test coverage
32 -----------------------
34 When doing modifications on the test cases, you can run
38 # This will run the test & report the result in the coverage data
39 $ make test-cov-build TEST=fib
41 # This will generate the html report with the current coverage data
44 # To reset the coverage data use