diff --git a/.gitignore b/.gitignore index 1538c91..2ac5901 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,9 @@ timing.exe *.gcno *.gcov +coverage/ +coverage*.info + # coverity intermediate directory etc. cov-int/ .coverity_* diff --git a/build.sh b/build.sh index 228afff..9338caf 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,12 @@ if [ -a test ] && [ -f test ] && [ -x test ]; then for f in *_tv.txt; do if (diff -i -w -B $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done fi fi + +lcov_opts="--capture --no-external --directory src -q" +lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info" + if [ -a testok.txt ] && [ -f testok.txt ]; then + [ "$LTC_COVERAGE" != "" ] && lcov $lcov_opts --output-file $lcov_out exit 0 fi exit 1 diff --git a/makefile b/makefile index 3a96ecf..626da35 100644 --- a/makefile +++ b/makefile @@ -275,6 +275,9 @@ profile: rm -f timing `find . -type f | grep [.][ao] | xargs` CFLAGS="$(CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" +lcov: + lcov `find -name 'coverage_*.info' -exec echo -n " -a {}" \;` -o coverage.info -q 2>/dev/null + genhtml coverage.info --output-directory coverage -q #This rule cleans the source tree of all compiled code, not including the pdf #documentation.