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>
This commit is contained in:
Jeff King 2010-08-31 11:56:53 -04:00 коммит произвёл Junio C Hamano
Родитель 16034fbe59
Коммит a54ce3ca9e
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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
}