From 24db294e957a119ceac4f82f903687b8d1c0be78 Mon Sep 17 00:00:00 2001 From: Peter Stamfest Date: Fri, 14 Mar 2014 07:31:00 +0100 Subject: [PATCH] if a test fails report original exit code instead of just 1 --- tests/functions | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/functions b/tests/functions index fecb0751..bef67185 100644 --- a/tests/functions +++ b/tests/functions @@ -23,17 +23,18 @@ fi DIFF="diff -u" function fail { - echo >&2 "FAILED: (rc=$?)" "$@" + RC=$? + echo >&2 "FAILED: (rc=$RC)" "$@" if [ -n "$CONTINUE" ] ; then return fi if [ -n "$INTERACTIVE" ] ; then read -p "Continue? (y/n)" YN if [ "$YN" != 'y' ] ; then - exit 1 + exit $RC fi else - exit 1 + exit $RC fi } -- 2.47.3