3 echo -n "Checking Code Coverage of unit tests"
4 DATE
=$
( date +%Y
%m
%d
%H
%M
%S
)
7 REV
=`LANG=C svn info | grep Revision | cut -c 11-`
8 echo " for SVN Revision: $REV"
9 TITLE
="OpenSync_SVN"$REV"_"$DATE
12 TITLE
="OpenSync_"$DATE
15 if ! [ -d coverage
/html
]; then
16 mkdir
-p coverage
/html
20 lcov
-t "$TITLE" -b ..
/ -d ..
/ -q -c -o coverage
/$TITLE.info
21 genhtml
--legend -t "$TITLE" -o coverage
/html
/$TITLE coverage
/$TITLE.info
&> /dev
/null
27 # XXX: reset counters ( lcov -z seems to be outdated... tries to dlete .da files instead of .gcda )
28 find ..
/ -name "*.gcda" |
xargs rm
30 echo -n "Code Coverage is: "
31 grep " %</td>" coverage
/html
/$TITLE/index.html |
sed -e "s/^[^>]*>//g" -e "s/<[^>]*>//g"
33 echo -e "\nTroubleshooting:\n If the Code Coverage number is quite low (less then 51%):"
34 echo -e "\t-Did you run any unit tests before $0?"
35 echo -e "\t-Did you build with enable_profiling=1?"
36 echo -e "\t-Run ALL available unit tests!"
37 echo -e "\t-Check if testcases in unit test are disabled!"
38 echo -e "\t-Fix unit tests and their test cases!"
39 echo -e "\t-Write new and more test cases!"