add possibility to create combined coverage

Define the environment variable LTC_COVERAGE to something, run testme.sh
with all the coverage compile time options enabled and then 'make lcov'
creates the combined coverage for all combinations of compile-time
options handled in testme.sh.

e.g. LTC_COVERAGE=1 ./testme.sh "makefile -j3" "-DUSE_LTM -DLTM_DESC -I../libtommath -fprofile-arcs -ftest-coverage" "../libtommath/libtommath.a -lgcov"
This commit is contained in:
Steffen Jaeckel 2015-08-30 17:17:05 +02:00
parent 21ed315527
commit 7db5760c91
3 changed files with 11 additions and 0 deletions

3
.gitignore vendored
View File

@ -57,6 +57,9 @@ timing.exe
*.gcno
*.gcov
coverage/
coverage*.info
# coverity intermediate directory etc.
cov-int/
.coverity_*

View File

@ -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

View File

@ -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.