if ($#ARGV >= 0) {
foreach my $idx (0..$#ARGV) {
next unless $ARGV[$idx] =~ /^-(\S+)$/;
+ $core = 1 if $1 eq 'core';
$verbose = 1 if $1 eq 'v';
$with_utf= 1 if $1 eq 'utf8';
if ($1 =~ /^deparse(,.+)?$/) {
}
unless (@ARGV) {
- foreach my $dir (qw(base comp cmd run io op pragma lib pod)) {
+ foreach my $dir (qw(base comp cmd run io op)) {
_find_tests($dir);
}
+ _find_tests("lib") unless $core;
my $mani = File::Spec->catdir($updir, "MANIFEST");
if (open(MANI, $mani)) {
while (<MANI>) { # similar code in t/harness
- if (m!^(ext/.+/([^/]+\.t|test\.pl)|lib/.+(\.t|test\.pl))\s!) {
- push @ARGV, $1;
- $OVER{$1} = File::Spec->catdir($updir, $1);
+ if (m!^(ext/\S+/([^/]+\.t|test\.pl)|lib/\S+?(\.t|test\.pl))\s!) {
+ $t = $1;
+ if (!$core || $t =~ m!^lib/[a-z]!)
+ {
+ push @ARGV, $t;
+ $OVER{$t} = File::Spec->catdir($updir, $t);
+ }
}
}
} else {
warn "$0: cannot open $mani: $!\n";
}
+ _find_tests('pod');
}
# Tests known to cause infinite loops for the perlcc tests.
}
}
$te = $test;
- chop($te);
+ $te =~ s/\.\w+$/./;
print "$te" . '.' x ($dotdotdot - length($te));
$test = $OVER{$test} if exists $OVER{$test};
or print "can't deparse '$deparse': $!.\n";
}
elsif ($type eq 'perl') {
- my $run = "./perl $testswitch $switch $utf $test |";
+ my $perl = $ENV{PERL} || './perl';
+ my $run = "$perl $testswitch $switch $utf $test |";
open(RESULTS,$run) or print "can't run '$run': $!.\n";
}
else {
$ok = 1;
}
else {
- if (/^(not )?ok (\d+)(\s*#.*)?/ &&
+ if (/^(not )?ok (\d+)[^#]*(\s*#.*)?/ &&
$2 == $next)
{
my($not, $num, $extra) = ($1, $2, $3);
}
if ($ENV{PERL_3LOG}) {
my $tpp = $test;
+ $tpp =~ s:^../::;
$tpp =~ s:/:_:g;
$tpp =~ s:\.t$::;
- rename("perl.3log", "perl.3log.$tpp");
+ rename("perl.3log", "perl.3log.$tpp") ||
+ die "rename: perl3.log to perl.3log.$tpp: $!\n";
}
$next = $next - 1;
if ($ok && $next == $max) {