summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2010-08-31 11:56:53 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-08-31 09:54:37 -0700
commita54ce3ca9e780f824f07519a6db83fe2d7575734 (patch)
treee3a174d66ae4194a11e3eca1dddfe24f56b0e4dc /t
parenttests: make test_must_fail more verbose (diff)
downloadtgif-a54ce3ca9e780f824f07519a6db83fe2d7575734.tar.xz
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-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 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
}