From 5a6f8d18a8c575cb30fea083b238d39d18f63083 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 30 Aug 2005 17:56:53 +0000 Subject: [PATCH] coverage.sh would bomb if there is no .gcno file. --- tests/ChangeLog | 4 ++++ tests/coverage.sh | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index ee6c18966..ad426e13d 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2005-08-30 Ulrich Drepper + + * coverage.sh: Handle case where there is no .gcno file at all. + 2005-08-29 Ulrich Drepper * Makefile.am (EXTRA_DIST): Add coverage. diff --git a/tests/coverage.sh b/tests/coverage.sh index d5fd6b63a..f09f644ff 100755 --- a/tests/coverage.sh +++ b/tests/coverage.sh @@ -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 -- 2.47.2