Merge pull request #159 from shane-kerr/coverage

Modified version of the "run-all.sh" which collects coverage information and produces a report.
This commit is contained in:
wtoorop 2016-04-02 16:49:02 -03:00
commit bbb498c680
1 changed files with 18 additions and 0 deletions

18
src/test/tpkg/run-all-lcov.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
export SRCDIR=`dirname $0`
. `dirname $0`/setup-env.sh
LCOV_MERGE=""
for TEST_PKG in ${SRCDIR}/*.tpkg
do
# when we run our test, we need to compile with profiling
CFLAGS="-fprofile-arcs -ftest-coverage -O0" "${TPKG}" $* exe "${TEST_PKG}"
# after the test is complete, we need to collect the coverage data
INFO_FILE=`echo $TEST_PKG | sed 's/.tpkg$//'`.info
geninfo $SRCDIR/.. -o $INFO_FILE
LCOV_MERGE="$LCOV_MERGE -a $INFO_FILE"
done
lcov $LCOV_MERGE -o run-all.info
genhtml run-all.info --output-directory coverage-html
"${TPKG}" r