cruxports/qrupdate/r32-drop-awk.patch

36 lines
934 B
Diff

--- a/test/report_results
+++ b/test/report_results
@@ -4,19 +4,27 @@
failed_total=0
cat $OUTS
-# if awk exists, use it to print total statistics
-if which awk > /dev/null ; then
- awk '/total:/ { passed += $3; failed += $5; }
- END { printf " TOTAL: PASSED %3d FAILED %3d\n", passed, failed; }' $OUTS
-fi
+ret=0
for out in $OUTS ; do
if [ ! -s $out ] ; then
echo " $out file empty (test crashed)!"
+ ret=1
else
if grep -q WARNING $out ; then
echo " $out produced warnings:"
grep WARNING $out
+ ret=1
+ fi
+ passed=$(grep total: $out | (read a b num d; echo $num))
+ passed_total=$((passed_total+passed))
+ failed=$(grep total: $out | (read a b c d num f; echo $num))
+ failed_total=$((failed_total+failed))
+ if test "$failed" -gt 0; then
+ echo " $out has failures"
+ ret=1
fi
fi
done
+printf "\n TOTAL: PASSED %3d FAILED %3d\n" "$passed_total" "$failed_total"
+exit $ret