test-lib.sh: Add check for invalid use of 'skip_all' facility
The 'skip_all' facility cannot be used after one or more tests have been executed using (for example) 'test_expect_success'. To do so results in invalid TAP output, which leads to 'prove' complaining of "Parse errors: No plan found in TAP output". Add a check for such invalid usage and abort the test with an error message to alert the test author. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Sep 1, 2012 at 19:13 UTC
bf4b7219322d007f3ebd2a002114956d025e4703
1 file changed
+4
t/test-lib.sh
+4
@@ -383,6 +383,10 @@ test_done () {
383
case "$test_failure" in
384
0)
385
# Maybe print SKIP message
386
+ if test -n "$skip_all" && test $test_count -gt 0
387
+ then
388
+ error "Can't use skip_all after running some tests"
389
+ fi
390
[ -z "$skip_all" ] || skip_all=" # SKIP $skip_all"
391
392
if test $test_external_has_tap -eq 0