3 RESULT_DIRECTORY
=lcov_analyse
5 rm -fr $RESULT_DIRECTORY
6 mkdir
$RESULT_DIRECTORY
7 rm -r .build
/profile
/regtests
/
9 lcov
-d .build
/profile
/ -o $RESULT_DIRECTORY/analyse.info
-c -b .
10 genhtml
-q -o $RESULT_DIRECTORY/ -legend -highlight $RESULT_DIRECTORY/analyse.info
11 html2text
-width 300 -nobs -ascii -o $RESULT_DIRECTORY/index.txt_tmp
$RESULT_DIRECTORY/index.html
12 AWS_LINES_INSTRUMENTED
=`cat $RESULT_DIRECTORY/index.txt_tmp | grep aws | awk '{print $7}'`
13 ADAINCLUDE_LINES_INSTRUMENTED
=`cat $RESULT_DIRECTORY/index.txt_tmp | grep adainc | awk '{print $7}'`
14 ADAINCLUDE_LINES_EXECUTED
=`cat $RESULT_DIRECTORY/index.txt_tmp | grep adainc | awk '{print $5}'`
16 INSTRUMENTED_LINES
=`cat $RESULT_DIRECTORY/index.txt_tmp | awk '/Instrumented lines/ {print $5}'`
18 let "INSTRUMENTED_LINES -= $AWS_LINES_INSTRUMENTED"
19 let "INSTRUMENTED_LINES -= $ADAINCLUDE_LINES_INSTRUMENTED"
21 EXECUTED_LINES
=`cat $RESULT_DIRECTORY/index.txt_tmp | awk '/Executed lines/ {print $7}'`
23 let "EXECUTED_LINES -= $ADAINCLUDE_LINES_EXECUTED"
25 CODE_COVERED
=`echo "(($EXECUTED_LINES*100)/$INSTRUMENTED_LINES)" | bc`
27 html2text
-style pretty
-nobs -ascii $RESULT_DIRECTORY/index.html |
30 echo $line |
grep "lines$" |
grep -v gcc |
grep -v adainclude |
31 grep -v morzhol |
grep -v aws |
32 awk '{printf "%-40s %-20s %s / %s %s\n", $1, $2, $6, $8, $9}'
35 echo -e Instrumented lines\
: $INSTRUMENTED_LINES
36 echo -e Executed lines\ \ \ \ \
: $EXECUTED_LINES
37 echo -e Code coverage \ \ \ \ \
: $CODE_COVERED%