]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
coverage.sh would bomb if there is no .gcno file.
authorUlrich Drepper <drepper@redhat.com>
Tue, 30 Aug 2005 17:56:53 +0000 (17:56 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 30 Aug 2005 17:56:53 +0000 (17:56 +0000)
tests/ChangeLog
tests/coverage.sh

index ee6c18966909780e88587699b2be31eaa5c45166..ad426e13dd3560841f250cdc1ff0d0cc6541abae 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * coverage.sh: Handle case where there is no .gcno file at all.
+
 2005-08-29  Ulrich Drepper  <drepper@redhat.com>
 
        * Makefile.am (EXTRA_DIST): Add coverage.
index d5fd6b63a785471801bb5c93dd36972aeb3b1cc0..f09f644ff26d2d09a2cfc2406014a62a52d50b1c 100755 (executable)
@@ -3,7 +3,7 @@
 cd ..
 
 for d in lib libasm libdw libdwfl libebl libelf src; do
-  tmp=../$d-data
+  tmp=$d-data
   cd $d
   unused=0
   for f in *.gcno; do
@@ -17,7 +17,11 @@ for d in lib libasm libdw libdwfl libebl libelf src; do
       unused=$(($unused + 1))
     fi
   done
-  gawk "{ copct=\$2; co=(\$3*copct)/100; toco+=(co+0); toli += (\$3+0); } END { printf \"%-12s %6.2f%% covered       unused files: %3d\n\", \"$d\", (toco*100)/toli, \"$unused\" }" $tmp
-  rm -f $tmp
+  if [ -f $tmp ]; then
+    gawk "{ copct=\$2; co=(\$3*copct)/100; toco+=(co+0); toli += (\$3+0); } END { printf \"%-12s %6.2f%% covered       unused files: %3d\n\", \"$d\", (toco*100)/toli, \"$unused\" }" $tmp
+    rm -f $tmp
+  else
+    printf "%-12s   0.00%% covered       unused files: %3d\n" "$d" $unused
+  fi
   cd ..
 done