diff --git a/t/test-lib.sh b/t/test-lib.sh
index acce3d06a8cba094d6eac88516dc316c8084e736..7422bba47e75e00073779e4b2d7a162862cdb426 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
}
test_run_ () {
- test_cleanup='eval_ret=$?'
+ test_cleanup=:
eval >&3 2>&4 "$1"
+ eval_ret=$?
eval >&3 2>&4 "$test_cleanup"
return 0
}
# the test to pass.
test_when_finished () {
- test_cleanup="eval_ret=\$?; { $*
- } && (exit \"\$eval_ret\"); $test_cleanup"
+ test_cleanup="{ $*
+ } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup"
}
# Most tests can use the created repository, but some may need to create more.