From b55db9bbda0aaffae3e59919e3d460ba935d8c22 Mon Sep 17 00:00:00 2001 From: Timon Reinold Date: Fri, 19 Jul 2024 20:20:19 +0200 Subject: filters: print "error" if filter failed Print "error" instead of "ok" also if the filter (or the $FILTERS_TEST_PREFIX, i.e. valgrind) failed, not just if its output is unexpected. Also include that exist status in the error message. Signed-off-by: Timon Reinold Acked-by: Robin Jarry --- filters/test.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'filters') diff --git a/filters/test.sh b/filters/test.sh index 39319d6b..ea04235a 100755 --- a/filters/test.sh +++ b/filters/test.sh @@ -37,13 +37,12 @@ for vec in $here/vectors/*.in; do tool=$(basename $vec | sed 's/-.*//') expected=${vec%%.in}.expected tmp=$(mktemp) - if ! $FILTERS_TEST_PREFIX $here/../$tool -f $vec > $tmp; then - fail=1 - fi - if diff -u "$expected" "$tmp"; then + status=0 + $FILTERS_TEST_PREFIX $here/../$tool -f $vec > $tmp || status=$? + if [ $status -eq 0 ] && diff -u "$expected" "$tmp"; then echo "ok $tool < $vec > $tmp" else - echo "error $tool < $vec > $tmp" + echo "error $tool < $vec > $tmp [status=$status]" fail=1 fi rm -f -- "$tmp" -- cgit