From 6137113dfd943e6f896f8b9c1a4df2b7d4e355ae Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 13 Jul 2004 09:13:39 +0000 Subject: no_plan support in test.pl p4raw-id: //depot/perl@23090 --- t/test.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 't/test.pl') diff --git a/t/test.pl b/t/test.pl index 9407129271..56bf3556c7 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"; + } } } -- cgit v1.2.1