From f829336d079e1b4139a278a4555e1b5ff24fd325 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 24 Feb 2011 12:36:14 +0100 Subject: [PATCH 1/1] wvtest/sh: Do not exit shell script unless $WVTEST_DIE_FAST is set If the shell script performs setup and cleanup for the test, it is important to cleanup even when the test fails. So by default, we do not exit, but only return the exit code of failed command. --- src/wvtest.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wvtest.sh b/src/wvtest.sh index 30574cbe..5f4c6651 100755 --- a/src/wvtest.sh +++ b/src/wvtest.sh @@ -40,7 +40,11 @@ _wvcheck() fi echo "! $WVCALLER_FILE:$WVCALLER_LINE $TEXT $OK" >&2 if [ "$CODE" -ne 0 ]; then - exit $CODE + if [ "$WVTEST_DIE_FAST" ]; then + exit $CODE + else + return $CODE + fi else return 0 fi -- 2.39.2