Simplify code coverage implementation

This commit is contained in:
Drew DeVault 2016-06-19 12:28:34 -04:00
parent 074238e9f4
commit 8758a2bd04
5 changed files with 30 additions and 196 deletions

View file

@ -8,4 +8,17 @@ do
ret+=$?
done
if grep 'enable-coverage:BOOL=YES' "$1/CMakeCache.txt"
then
echo "Generating coverage reports"
rm -rf "$1/coverage"
mkdir "$1/coverage"
lcov --directory "$1" \
--capture \
--output-file "$1/coverage/lcov.info"
lcov --remove "$1/coverage/lcov.info" 'test/*' '/usr/*' \
--output-file "$1/coverage/lcov.info.clean"
genhtml -o "$1/coverage/" "$1/coverage/lcov.info.clean"
fi
exit $ret