summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Ramsay Jones <ramsay@ramsay1.demon.co.uk>2012-09-01 19:26:21 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-09-02 19:32:31 -0700
commitd87bd7c15beb688294cf4adb1b719dc4e413c58f (patch)
tree5866f40be8dab29f35498365b20aef4dd38df768
parenttest-lib.sh: Add check for invalid use of 'skip_all' facility (diff)
downloadtgif-d87bd7c15beb688294cf4adb1b719dc4e413c58f.tar.xz
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 <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/test-lib.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7f4cb67c0f..600ed835ee 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -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