-
Notifications
You must be signed in to change notification settings - Fork 14
Generate code coverage reports
Michael Hall edited this page May 14, 2019
·
6 revisions
You need to have lcov
installed.
Additionally, these instructions will be focused on running tests from CLion. If you are running from command line it should be a very similar process.
The first thing you need to do each time is clear the output from the previous coverage counters.
cd /path/to/pandora
cd cmake-build-debug/test/CMakeFiles/pandora_test.dir
lcov --directory . --zerocounters
Run the test suite from CLion.
lcov --directory . --capture \
--exclude '/usr/local/include/boost/*' \
--exclude '*_test.cpp' \
--exclude '*.h' \
--exclude '/usr/include/*' \
--exclude '*cmake-build-debug*' \
--exclude '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/*' \
--output-file pandora_test.info
lcov
on your system may or may not raise an error with the --exclude
arguments as these may have different paths to your system. You can remove them if you want but keep in the mind the coverage report will contain a bunch of other files not related to pandora. For example, if using Linux, you wont need to exclude the Xcode directory.
genhtml --show-details --legend pandora_test.info
And then open the index.html
file generated in that directory.