From 541a6eec8cc3dff290051b2f711ac64ad4862ce6 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Tue, 16 Aug 2016 12:45:25 +0200 Subject: [PATCH] Instead of using -e, check for error explicitly and dump last lines from stderr log --- debian/rules | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index b20cf5a..032b4bb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,12 +1,18 @@ #!/bin/bash -set -eu +set -u set -o pipefail [ "$1" = binary ] || exit 0 ./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) 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) %"