Skip to content

Commit d0b8a61

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c8e141 commit d0b8a61

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

t/test-lib.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ test_might_fail () {
622622
if test $exit_code -gt 129 -a $exit_code -le 192; then
623623
echo >&2 "test_might_fail: died by signal: $*"
624624
return 1
625+
elif test $exit_code = 127; then
626+
echo >&2 "test_might_fail: command not found: $*"
627+
return 1
625628
fi
626629
return 0
627630
}

0 commit comments

Comments
 (0)