summaryrefslogtreecommitdiff
path: root/src/templating
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-04-01 12:44:10 +0200
committerChristian Grothoff <christian@grothoff.org>2024-04-01 12:44:10 +0200
commit2805413486701578c642a24faa1a0c698f8f3bd5 (patch)
tree3b6e545f54ca98c5a9b165f21f100331b5992f14 /src/templating
parent4b3c21a36e5220be99fd990e005dc452ef4dbbe0 (diff)
downloadexchange-2805413486701578c642a24faa1a0c698f8f3bd5.tar.gz
exchange-2805413486701578c642a24faa1a0c698f8f3bd5.tar.bz2
exchange-2805413486701578c642a24faa1a0c698f8f3bd5.zip
actually fail tests on error
Diffstat (limited to 'src/templating')
-rwxr-xr-xsrc/templating/dotest.sh16
-rwxr-xr-xsrc/templating/run-original-tests.sh9
2 files changed, 11 insertions, 14 deletions
diff --git a/src/templating/dotest.sh b/src/templating/dotest.sh
index 99ff8b201..7945ca5c5 100755
--- a/src/templating/dotest.sh
+++ b/src/templating/dotest.sh
@@ -1,20 +1,26 @@
#!/bin/sh
+# Exit, with error message (hard failure)
+exit_fail() {
+ echo " FAIL: " "$@" >&2
+ exit 1
+}
+
mustach=${mustach:-../mustach}
echo starting test
if test "$NOVALGRIND" = 1
then
- $mustach "$@" > resu.last
+ $mustach "$@" > resu.last || exit_fail "ERROR! mustach command failed ($?)!"
else
- valgrind $mustach "$@" > resu.last 2> vg.last
+ valgrind $mustach "$@" > resu.last 2> vg.last || exit_fail "ERROR! mustach command failed ($?)!"
sed -i 's:^==[0-9]*== ::' vg.last
- awk '/^ *total heap usage: .* allocs, .* frees,.*/{if($$4-$$6)exit(1)}' vg.last || echo "ERROR! Alloc/Free issue"
+ awk '/^ *total heap usage: .* allocs, .* frees,.*/{if($$4-$$6)exit(1)}' vg.last || exit_fail "ERROR! Alloc/Free issue"
fi
if diff -w resu.ref resu.last
then
echo "result ok"
else
- echo "ERROR! Result differs"
+ exit_fail "ERROR! Result differs"
fi
echo
-
+exit 0
diff --git a/src/templating/run-original-tests.sh b/src/templating/run-original-tests.sh
index 05b57ffd6..21481a286 100755
--- a/src/templating/run-original-tests.sh
+++ b/src/templating/run-original-tests.sh
@@ -4,15 +4,6 @@ set -eux
export CFLAGS="-g"
-function build()
-{
- make clean
- make
-}
-
-# Install rebuild-on-exit handler (except for kill -9)
-trap build EXIT
-
echo "Ensuring clean state on entry to upstream tests ..."
make clean