Created
May 9, 2012 11:04
-
-
Save eiichiroi/2643761 to your computer and use it in GitHub Desktop.
How to measure the coverage of pficommon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## Please install lcov first. | |
# wget http://downloads.sourceforge.net/ltp/lcov-1.9.tar.gz | |
# tar xzf lcov-1.9.tar.gz | |
# cd lcov-1.9 | |
# sudo make install | |
## Build and measure the coverage with running tests | |
CXXFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-lgcov" ./waf configure | |
./waf | |
./waf --checkall | |
## Capture the coverage | |
lcov --capture --directory ./build/src --base-directory ./src --output-file pficommon-coverage.info | |
## Exclude standard library | |
lcov --remove pficommon-coverage.info /usr/include/\* --output-file pficommon-coverage-excluded.info | |
## Generate html | |
genhtml --title pficommon --output-directory ./coverage pficommon-coverage-excluded.info | |
## See ./coverage/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment