From: Nicholas Clark Date: Tue, 13 Jul 2004 09:13:39 +0000 (+0000) Subject: no_plan support in test.pl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6137113dfd943e6f896f8b9c1a4df2b7d4e355ae;p=p5sagit%2Fp5-mst-13.2.git no_plan support in test.pl p4raw-id: //depot/perl@23090 --- diff --git a/t/test.pl b/t/test.pl index 9407129..56bf355 100644 --- a/t/test.pl +++ b/t/test.pl @@ -5,6 +5,7 @@ $Level = 1; my $test = 1; my $planned; +my $noplan; $TODO = 0; $NO_ENDING = 0; @@ -13,18 +14,27 @@ sub plan { my $n; if (@_ == 1) { $n = shift; + if ($n eq 'no_plan') { + undef $n; + $noplan = 1; + } } else { my %plan = @_; $n = $plan{tests}; } - print STDOUT "1..$n\n"; + print STDOUT "1..$n\n" unless $noplan; $planned = $n; } END { my $ran = $test - 1; - if (!$NO_ENDING && defined $planned && $planned != $ran) { - print STDERR "# Looks like you planned $planned tests but ran $ran.\n"; + if (!$NO_ENDING) { + if (defined $planned && $planned != $ran) { + print STDERR + "# Looks like you planned $planned tests but ran $ran.\n"; + } elsif ($noplan) { + print "1..$ran\n"; + } } }