From d0b8a61742714b93b614f9823491a7557879dfb9 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 31 Aug 2010 12:26:57 -0500 Subject: 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 --- t/test-lib.sh | 3 +++ 1 file changed, 3 insertions(+) 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 } -- cgit v1.2.3