summaryrefslogtreecommitdiff
path: root/t/test.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-07-13 09:13:39 +0000
committerNicholas Clark <nick@ccl4.org>2004-07-13 09:13:39 +0000
commit6137113dfd943e6f896f8b9c1a4df2b7d4e355ae (patch)
tree35fdc9d12c81b72c4e92fcdfbec41509a949f9ff /t/test.pl
parentca28b541c9845a7610e3eca36472b9ee994eb64c (diff)
downloadperl-6137113dfd943e6f896f8b9c1a4df2b7d4e355ae.tar.gz
no_plan support in test.pl
p4raw-id: //depot/perl@23090
Diffstat (limited to 't/test.pl')
-rw-r--r--t/test.pl16
1 files changed, 13 insertions, 3 deletions
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";
+ }
}
}