summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-08-12 15:51:42 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-08-12 18:01:37 +0200
commit804d4a0d92a2e107aad38198ac08f1d2d64b5e53 (patch)
tree9633f384cbc4d5b3f89643d43181f2c1eb5b5d4c
parent80f3aeb04d043356bd98de7714fc164b3fff3861 (diff)
ensure that testcases exiting because of set -e aren't successful
Git-Dch: Ignore
-rw-r--r--test/integration/framework12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 005e31bd3..72c899e32 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -131,13 +131,23 @@ exitwithstatus() {
exit $((EXIT_CODE <= 255 ? EXIT_CODE : 255));
}
+shellsetedetector() {
+ local exit_status=$?
+ if [ "$exit_status" != '0' ]; then
+ echo >&2 "${CERROR}E: Looks like the testcases ended prematurely with exitcode: ${exit_status}${CNORMAL}"
+ if [ "$EXIT_CODE" = '0' ]; then
+ EXIT_CODE="$exit_status"
+ fi
+ fi
+}
+
addtrap() {
if [ "$1" = 'prefix' ]; then
CURRENTTRAP="$2 $CURRENTTRAP"
else
CURRENTTRAP="$CURRENTTRAP $1"
fi
- trap "$CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+ trap "shellsetedetector; $CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
}
setupenvironment() {