Skip to content

Instantly share code, notes, and snippets.

@eiichiroi
Created May 9, 2012 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiichiroi/2643761 to your computer and use it in GitHub Desktop.
Save eiichiroi/2643761 to your computer and use it in GitHub Desktop.
How to measure the coverage of pficommon
#!/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