(Automated Tests) All tests passing on Ubuntu 16.04
[platform/core/uifw/dali-toolkit.git] / automated-tests / coverage.sh
index 98798db..c5fbed7 100755 (executable)
@@ -1,22 +1,30 @@
 #!/bin/bash
 
-( cd ../build/slp ; make cov_data )
+( cd ../build/tizen ; make cov_data )
 
-for i in `find . -name Makefile` ; do
+# From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
+LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
+
+for i in `find . -name "*.dir"` ; do
     (
-        cd $(dirname $i)
+        cd $i
         echo `pwd`
         covs=( `ls *.gcda 2>/dev/null` )
         if [[ $? -eq 0 ]]
         then
-            make coverage
+            lcov $LCOV_OPTS --directory . -c -o dali.info
+            lcov $LCOV_OPTS --remove dali.info "/usr/include/*" "*/automated-tests/*" "*/dali-env/*" -o dali.info
+            if [ ! -s dali.info ]
+            then
+              rm -f dali.info
+            fi
         fi
     )
 done
 
 (
     cd .. ;
-    genhtml -o build/slp/doc/coverage `find . -name dali.info`
+    genhtml $LCOV_OPTS -o build/tizen/doc/coverage `find . -name dali.info`
 )
 
-
+echo "Coverage output: ../build/tizen/doc/coverage/index.html"