mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
CI: Avoid divide by zero error when generating coverage files
This commit is contained in:
parent
04c8a6bde7
commit
179e4903f1
1 changed files with 5 additions and 3 deletions
|
@ -90,9 +90,11 @@ function check_group_coverage {
|
|||
TOTAL=$(echo $(grep "$i" $DATA | cut -f 3) | tr " " "+" | bc)
|
||||
fi
|
||||
|
||||
PERCENTAGE=$(echo "scale=3;100*$RUN/$TOTAL" | bc | tr "\n" " ")
|
||||
printf "%-50s\t%12s\t%6s %%\n" "$i" "$RUN/$TOTAL" $PERCENTAGE |
|
||||
sed 's|#|/|g' >>$OUTPUT
|
||||
if [ $TOTAL -ne 0 ]; then
|
||||
PERCENTAGE=$(echo "scale=3;100*$RUN/$TOTAL" | bc | tr "\n" " ")
|
||||
printf "%-50s\t%12s\t%6s %%\n" "$i" "$RUN/$TOTAL" $PERCENTAGE |
|
||||
sed 's|#|/|g' >>$OUTPUT
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue