1
0
Fork 0

Add script to generate coverage reports using lcov.

This commit is contained in:
Moritz Grimm 2015-05-12 12:06:49 +02:00
parent 9c842281fa
commit 36511d9408
4 changed files with 41 additions and 3 deletions

View File

@ -10,4 +10,4 @@ AM_CPPFLAGS = @EZ_CPPFLAGS@
AM_CFLAGS = @EZ_CFLAGS@
AM_LDFLAGS = @EZ_LDFLAGS@ -avoid-version
CLEANFILES = *~ *.core core
CLEANFILES = *~ *.core core *.gcno *.gcda

38
gen-coverage-report.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
PROGRAM="ezstream"
set -e
trap '' 1
trap 'exit 1' 2 15
BUILD_DATE=$(date '+%Y%m%d')
DESTDIR=$PROGRAM-coverage-$BUILD_DATE
if [ -z "$(which lcov)" ]; then
echo "lcov is required" >&2
exit 1
fi
if [ -z "$(which genhtml)" ]; then
echo "genhtml is required" >&2
exit 1
fi
rm -rf "$DESTDIR"
./configure CFLAGS='-O0 -fprofile-arcs -ftest-coverage'
make clean
make check
mkdir -p $DESTDIR
lcov --capture --output-file $DESTDIR/coverage.tmp \
--rc lcov_branch_coverage=1 \
--directory src \
--test-name "Ezstream $VERSION"
genhtml --prefix . --output-directory $DESTDIR \
--branch-coverage --function-coverage \
--rc lcov_branch_coverage=1 \
--title "Ezstream $VERSION" --legend --show-detail $DESTDIR/coverage.tmp
echo "Coverage report available under $DESTDIR"

View File

@ -42,4 +42,4 @@ AM_CPPFLAGS = @EZ_CPPFLAGS@ -I$(top_srcdir)/compat
AM_CFLAGS = @EZ_CFLAGS@
AM_LDFLAGS = @EZ_LDFLAGS@ -avoid-version
CLEANFILES = core *.core *~ .*~
CLEANFILES = core *.core *~ .*~ *.gcno *.gcda

View File

@ -24,4 +24,4 @@ AM_LDFLAGS = @EZ_LDFLAGS@
EXTRA_DIST = compat.h
CLEANFILES = *~ *.core core
CLEANFILES = *~ *.core core *.gcno *.gcda