run 1.14 KB
Newer Older
Slava Monich's avatar
Slava Monich committed
1 2 3 4 5
#!/bin/bash
#
# This script requires lcov to be installed
#

6
TESTS="test_media_type test_mms_codec test_delivery_ind \
7
test_read_ind test_read_report test_resize test_retrieve \
8
test_retrieve_cancel test_retrieve_no_proxy test_retrieve_order \
9
test_send test_settings"
Slava Monich's avatar
Slava Monich committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
FLAVOR="release"

pushd `dirname $0` > /dev/null
COV_DIR="$PWD"
pushd .. > /dev/null
TEST_DIR="$PWD"
pushd .. > /dev/null
BASE_DIR="$PWD"
popd > /dev/null
popd > /dev/null
popd > /dev/null

for t in $TESTS ; do
    make -C "$TEST_DIR/$t" clean
done

for t in $TESTS ; do
    make GCOV=1 -C "$TEST_DIR/$t" $FLAVOR || exit 1
done

for t in $TESTS ; do
    pushd "$TEST_DIR/$t"
32
    build/$FLAVOR/$t || exit 1
Slava Monich's avatar
Slava Monich committed
33 34 35
    popd
done

36 37 38 39
# LCOV 1.10 has branch coverage disabled per default
LCOV_OPT="--rc lcov_branch_coverage=1"
GENHTML_OPT="--branch-coverage"

Slava Monich's avatar
Slava Monich committed
40 41 42
FULL_COV="$COV_DIR/full.gcov"
MMSLIB_COV="$COV_DIR/mms-lib.gcov"
rm -f "$FULL_COV" "$MMSLIB_COV"
43 44 45
lcov $LCOV_OPT -c -d "$BASE_DIR/build/$FLAVOR" -b "$BASE_DIR" -o "$FULL_COV" || exit 1
lcov $LCOV_OPT -e "$FULL_COV" "$BASE_DIR/src/*" -o "$MMSLIB_COV" || exit 1
genhtml $GENHTML_OPT -t mms-engine "$MMSLIB_COV" --output-directory "$COV_DIR/results" || exit 1