Skip to content

Commit a44f9ae

Browse files
committed
Following the excellent suggestion of @mbland
See sstephenson#110 for an in-depth explanation on the rationale for these changes.
1 parent cddeecc commit a44f9ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: libexec/bats-core/bats-exec-test

+2-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ bats_debug_trap() {
235235
bats_error_trap() {
236236
local status="$?"
237237
if [[ -z "$BATS_TEST_COMPLETED" ]]; then
238-
BATS_ERROR_STATUS="$status"
238+
BATS_ERROR_STATUS="${BATS_ERROR_STATUS:-$status}"
239239
if [[ "$BATS_ERROR_STATUS" -eq 0 ]]; then
240240
BATS_ERROR_STATUS=1
241241
fi
@@ -330,6 +330,7 @@ bats_perform_test() {
330330

331331
BATS_TEST_COMPLETED=""
332332
BATS_TEARDOWN_COMPLETED=""
333+
BATS_ERROR_STATUS=""
333334
trap "bats_debug_trap \"\$BASH_SOURCE\"" debug
334335
trap "bats_error_trap" err
335336
trap "bats_teardown_trap" exit

0 commit comments

Comments
 (0)