1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00
ezstream/gen-coverage-report.sh

39 lines
790 B
Bash
Raw Normal View History

#!/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"