]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib.sh: Suppress the "passed all ..." message if no tests run
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Sat, 1 Sep 2012 18:26:21 +0000 (19:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Sep 2012 02:32:31 +0000 (19:32 -0700)
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>
t/test-lib.sh

index 7f4cb67c0fd53a6e92c6ed5bf9c2f23181365917..600ed835ee4da183c61101af3628925061b94823 100644 (file)
@@ -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