/
run
executable file
·45 lines (38 loc) · 1.14 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#
# This script requires lcov to be installed
#
TESTS="test_media_type test_mms_codec test_delivery_ind \
test_read_ind test_read_report test_resize test_retrieve \
test_retrieve_cancel test_retrieve_no_proxy test_retrieve_order \
test_send test_settings"
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"
build/$FLAVOR/$t || exit 1
popd
done
# LCOV 1.10 has branch coverage disabled per default
LCOV_OPT="--rc lcov_branch_coverage=1"
GENHTML_OPT="--branch-coverage"
FULL_COV="$COV_DIR/full.gcov"
MMSLIB_COV="$COV_DIR/mms-lib.gcov"
rm -f "$FULL_COV" "$MMSLIB_COV"
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