From: Peter Stamfest Date: Fri, 14 Mar 2014 06:31:00 +0000 (+0100) Subject: if a test fails report original exit code instead of just 1 X-Git-Tag: v1.5.0-rc1~117^2~2^2~19^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24db294e957a119ceac4f82f903687b8d1c0be78;p=thirdparty%2Frrdtool-1.x.git if a test fails report original exit code instead of just 1 --- 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 }