diff --git a/regression/scaffold b/regression/scaffold index e95458a..85d191d 100644 --- a/regression/scaffold +++ b/regression/scaffold @@ -51,19 +51,28 @@ function filter_dd function cmd { echo "% $@" - "$@" 2>&1 | replace_path && return 0 - return 1 + if ! ( + exec 3>&1 + rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1` + exit $rv + ) ; then + echo "% FAIL: The above command should succeed but failed." + exit 1 + fi } # usage: shouldfail .. function shouldfail { echo "% $@" - ( - "$@" 2>&1 || return 0 - return 1 - ) | replace_path - return $? + if ( + exec 3>&1 + rv=`(("$@" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1` + exit $rv + ) ; then + echo "% FAIL: The above command should fail but succeeded." + exit 1 + fi } # usage: list_files diff --git a/regression/t-032.sh b/regression/t-032.sh index b1d5f19..bba401e 100755 --- a/regression/t-032.sh +++ b/regression/t-032.sh @@ -28,7 +28,7 @@ shouldfail guilt import -P foo3 foo cmd guilt import -P foo2 foo # ok -shouldfail guilt import foo +cmd guilt import foo # duplicate patch name (implicit) shouldfail guilt import foo