@matheusbsbs / matheus-bagliano / commits / d0b8a61742
Fork 0

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 <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Aug 31, 2010 at 12:26 UTC d0b8a61742714b93b614f9823491a7557879dfb9
1 file changed +3
t/test-lib.sh
+3
@@ -622,6 +622,9 @@ test_might_fail () {
622 if test $exit_code -gt 129 -a $exit_code -le 192; then
623 echo >&2 "test_might_fail: died by signal: $*"
624 return 1
625 + elif test $exit_code = 127; then
626 + echo >&2 "test_might_fail: command not found: $*"
627 + return 1
628 fi
629 return 0
630 }