lean2/doc/make/coverage.md
Leonardo de Moura b92a3e482d Create doc directory for documentation. Move wiki pages to doc. Reorganize README.md
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-13 10:57:45 -07:00

903 B

Instructions for Testing and Measuring Code Coverage

To measure code coverage, compile TESTCOV build using g++:

mkdir -p build/testcov
cd build/testcov
cmake -DCMAKE_BUILD_TYPE=TESTCOV -DCMAKE_CXX_COMPILER=g++-4.8 -G Ninja ../../src
ninja

and run test cases:

ctest

and collect coverage data using lcov and gcov:

lcov -c -b ../../src -d . -o cov.info --no-external --gcov-tool gcov-4.8

and generate HTML output:

genhtml cov.info --output-directory lcov

Note: make sure that the version of gcov matches with the one of g++. Also try to use the latest lcov if you have a problem with the existing one.