aboutsummaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorTimon Reinold <tirei+aerc@agon.one>2024-07-19 20:20:19 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-04 17:48:44 +0200
commitb55db9bbda0aaffae3e59919e3d460ba935d8c22 (patch)
treefc18c92fba6e02e981cc685e339ddd1294c53ac3 /filters
parent954c812d840030f3013ef06621dd537c8b14b23d (diff)
downloadaerc-b55db9bbda0aaffae3e59919e3d460ba935d8c22.tar.gz
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 <tirei+aerc@agon.one> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'filters')
-rwxr-xr-xfilters/test.sh9
1 files changed, 4 insertions, 5 deletions
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"