Skip to content

Commit bf4b721

Browse files
Ramsay Jonesgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1c0cc75 commit bf4b721

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

t/test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ test_done () {
383383
case "$test_failure" in
384384
0)
385385
# 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
386390
[ -z "$skip_all" ] || skip_all=" # SKIP $skip_all"
387391

388392
if test $test_external_has_tap -eq 0

0 commit comments

Comments
 (0)