summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2010-08-31 12:26:57 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-08-31 11:40:20 -0700
commitd0b8a61742714b93b614f9823491a7557879dfb9 (patch)
tree1546925934cd9be44f0dc8c286bb42237d14b34d
parenttests: make test_might_fail more verbose (diff)
downloadtgif-d0b8a61742714b93b614f9823491a7557879dfb9.tar.xz
tests: make test_might_fail fail on missing commands
Detect and report hard-to-notice spelling mistakes like test_might_fail "git config --unset whatever" (the extra quotes prevent the shell from running git as intended; instead, the shell looks for a "git config --unset whatever" file). Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/test-lib.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 16ceb5316f..7da490de01 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -622,6 +622,9 @@ test_might_fail () {
if test $exit_code -gt 129 -a $exit_code -le 192; then
echo >&2 "test_might_fail: died by signal: $*"
return 1
+ elif test $exit_code = 127; then
+ echo >&2 "test_might_fail: command not found: $*"
+ return 1
fi
return 0
}