Instead of using -e, check for error explicitly and dump last lines from stderr log

This commit is contained in:
Johannes 'josch' Schauer 2016-08-16 12:45:25 +02:00
parent fe80040edc
commit 541a6eec8c

8
debian/rules vendored
View file

@ -1,12 +1,18 @@
#!/bin/bash #!/bin/bash
set -eu set -u
set -o pipefail set -o pipefail
[ "$1" = binary ] || exit 0 [ "$1" = binary ] || exit 0
./generate_testcases.sh | xargs --max-args=8 ./check.sh 2>../buildlog.txt | tee ../results.txt ./generate_testcases.sh | xargs --max-args=8 ./check.sh 2>../buildlog.txt | tee ../results.txt
if [ $? -ne 0 ]; then
echo "Generating the testcases failed. The last 10 lines from the stderr log are:"
tail --lines=10 ../buildlog.txt
exit 1
fi
num_results=$(wc -l < ../results.txt) num_results=$(wc -l < ../results.txt)
echo "Num-Testcases: $num_results" echo "Num-Testcases: $num_results"
echo "Perc-All-Agree: $(echo "scale=2;$(grep -E ' 0 0 0$| 1 1 1$' ../results.txt | wc -l)*100/$num_results" | bc) %" echo "Perc-All-Agree: $(echo "scale=2;$(grep -E ' 0 0 0$| 1 1 1$' ../results.txt | wc -l)*100/$num_results" | bc) %"