summaryrefslogtreecommitdiffstats
path: root/tests/coverage.sh
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2005-08-30 17:56:53 +0000
committerUlrich Drepper <[email protected]>2005-08-30 17:56:53 +0000
commit5a6f8d18a8c575cb30fea083b238d39d18f63083 (patch)
treed0dcf712d2c2971bf7abd3c58b4d386e74fc63ed /tests/coverage.sh
parent39cec7a022159c4d05867c3ca5d8f5c4df462d95 (diff)
coverage.sh would bomb if there is no .gcno file.
Diffstat (limited to 'tests/coverage.sh')
-rwxr-xr-xtests/coverage.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/coverage.sh b/tests/coverage.sh
index d5fd6b63..f09f644f 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