Move the lcov report in a separate action
authorMatthieu Patou <mat@matws.net>
Fri, 12 Nov 2010 09:37:02 +0000 (12:37 +0300)
committerMatthieu Patou <mat@matws.net>
Tue, 23 Nov 2010 18:10:10 +0000 (21:10 +0300)
build_test.fns

index b5cb71587b7726cac2330b072a147063da90f9a7..9a9fe8d5051284066286e9c16593a7429db47714 100644 (file)
@@ -289,6 +289,41 @@ do_make() {
        return 0
 }
 
+
+############################
+# do the coverage report
+############################
+
+action_lcovreport() {
+       if [ "$LCOV_REPORT" = "yes" ]; then
+               case "$tree" in
+               lorikeet-heimdal*)
+                       lcov --directory $builddir --capture --output-file $builddir/$tree.lcov.info
+                       ;;
+               samba_3_master*)
+                       lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
+                       ;;
+               samba_4*)
+                       # ugly hack for s4, as lcov is otherwise not able to find
+                       # these files
+                       rm -f heimdal/lib/*/{lex,parse,sel-lex}.{gcda,gcno}
+                       lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
+                       ;;
+               *)
+                       lcov --base-directory $builddir --directory $builddir --capture --output-file $builddir/$tree.lcov.info
+                       ;;
+               esac
+               genhtml -o $builddir/coverage $builddir/$tree.lcov.info
+               rc=$?
+               echo "return code: $rc"
+       else
+               echo "LCOV_REPORT not set and lcovreport asked"
+               echo "Most probably an error please fix !"
+               return 1
+       fi
+}
+
+
 ############################
 # configure the tree
 ############################
@@ -791,26 +826,6 @@ test_tree() {
                        fi
                done
 
-               if [ "$LCOV_REPORT" = "yes" ]; then
-                       case "$tree" in
-                       lorikeet-heimdal*)
-                               lcov --directory $builddir --capture --output-file $builddir/$tree.lcov.info
-                               ;;
-                       samba_3_master*)
-                               lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
-                               ;;
-                       samba_4*)
-                               # ugly hack for s4, as lcov is otherwise not able to find 
-                               # these files
-                               rm -f heimdal/lib/*/{lex,parse,sel-lex}.{gcda,gcno}
-                               lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
-                               ;;
-                       *)
-                               lcov --base-directory $builddir --directory $builddir --capture --output-file $builddir/$tree.lcov.info
-                               ;;
-                       esac
-                       genhtml -o $builddir/coverage $builddir/$tree.lcov.info
-               fi
 
                if [ "$noclean" = "yes" ]; then
                        echo cleanup skipped!