From: Jeff King Date: Tue, 31 Aug 2010 15:56:53 +0000 (-0400) Subject: tests: make test_must_fail fail on missing commands X-Git-Tag: v1.7.3-rc1~12^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a54ce3ca9e780f824f07519a6db83fe2d7575734 tests: make test_must_fail fail on missing commands The point of it is to run a command that produces failure. A missing command is more likely an error in the test script (e.g., using 'test_must_fail "command with arguments"', or relying on a missing command). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/t/test-lib.sh b/t/test-lib.sh index 285bfd8943..dbb13af33e 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -598,6 +598,9 @@ test_must_fail () { elif test $exit_code -gt 129 -a $exit_code -le 192; then echo >&2 "test_must_fail: died by signal: $*" return 1 + elif test $exit_code = 127; then + echo >&2 "test_must_fail: command not found: $*" + return 1 fi return 0 }