From: Jonathan Nieder Date: Tue, 31 Aug 2010 17:26:57 +0000 (-0500) Subject: tests: make test_might_fail fail on missing commands X-Git-Tag: v1.7.3-rc1~12^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d0b8a61742714b93b614f9823491a7557879dfb9;p=git.git 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 Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff --git a/t/test-lib.sh b/t/test-lib.sh index 16ceb5316..7da490de0 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 }