Generating code coverage report with gcc, gcov, and lcov

CodeMaven

Generating Code Coverage Report Using GNU Gcov and Lcov

cmake -DCOVERAGE=1 .
make -j8
app/tests/runTests
lcov -c --directory . --rc lcov_branch_coverage=1 --output-file all.info
lcov --remove all.info '/usr/*' '3rdparty/*' 'app/tests/*' --rc lcov_branch_coverage=1 --output-file selected.info
genhtml selected.info --rc lcov_branch_coverage=1 --output-directory out

Author

Gabor Szabo (szabgab) Gabor Szabo