Skip to content

Commit

Permalink
test-lib.sh: Suppress the "passed all ..." message if no tests run
Browse files Browse the repository at this point in the history
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 <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Sep 3, 2012
1 parent bf4b721 commit d87bd7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ test_done () {

if test $test_external_has_tap -eq 0
then
say_color pass "# passed all $msg"
if test $test_count -gt 0
then
say_color pass "# passed all $msg"
fi
say "1..$test_count$skip_all"
fi

Expand Down

0 comments on commit d87bd7c

Please sign in to comment.