{"thread":{"id":"31412","subject":"[PATCH 6/6] test-lib.sh: Suppress the \"passed all ...\" message if no tests run","startedAt":"2012-09-01T18:26:21Z","lastAt":"2012-09-01T18:26:21Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"198205","messageId":"5042534D.3030600@ramsay1.demon.co.uk","threadId":"31412","inReplyTo":null,"subject":"[PATCH 6/6] test-lib.sh: Suppress the \"passed all ...\" message if no tests run","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-09-01T18:26:21Z","receivedAt":"2012-09-01T18:26:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIf a test script issues a test_done without executing any tests, for\nexample when using the 'skip_all' facility, the output looks something\nlike this:\n\n    $ ./t9159-git-svn-no-parent-mergeinfo.sh\n    # passed all 0 test(s)\n    1..0 # SKIP skipping git svn tests, svn not found\n    $\n\nThe \"passed all 0 test(s)\" comment line, while correct, looks a little\nstrange. Add a check to suppress this message if no tests have actually\nbeen run.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nI suspect some people would disagree with this one. Indeed, this only\nirritates me when I'm feeling grumpy (so most days then). :-D\nIt's clearly not important (I just happened to be making changes in\nthis area), so drop this one if you feel it's not justified.\n\nATB,\nRamsay Jones\n\n t/test-lib.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 283d27a..f8e3733 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -391,7 +391,10 @@ test_done () {\n \n \t\tif test $test_external_has_tap -eq 0\n \t\tthen\n-\t\t\tsay_color pass \"# passed all $msg\"\n+\t\t\tif test $test_count -gt 0\n+\t\t\tthen\n+\t\t\t\tsay_color pass \"# passed all $msg\"\n+\t\t\tfi\n \t\t\tsay \"1..$test_count$skip_all\"\n \t\tfi\n \n-- \n1.7.12\n"}]}