Skip to content

Commit d87bd7c

Browse files
Ramsay Jonesgitster
authored andcommitted
test-lib.sh: Suppress the "passed all ..." message if no tests run
If a test script issues a test_done without executing any tests, for example when using the 'skip_all' facility, the output looks something like this: $ ./t9159-git-svn-no-parent-mergeinfo.sh # passed all 0 test(s) 1..0 # SKIP skipping git svn tests, svn not found $ The "passed all 0 test(s)" comment line, while correct, looks a little strange. Add a check to suppress this message if no tests have actually been run. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf4b721 commit d87bd7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/test-lib.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,10 @@ test_done () {
391391

392392
if test $test_external_has_tap -eq 0
393393
then
394-
say_color pass "# passed all $msg"
394+
if test $test_count -gt 0
395+
then
396+
say_color pass "# passed all $msg"
397+
fi
395398
say "1..$test_count$skip_all"
396399
fi
397400

0 commit comments

Comments
 (0)