diff options
-rwxr-xr-x | t/TEST | 21 | ||||
-rw-r--r-- | t/harness | 21 |
2 files changed, 36 insertions, 6 deletions
@@ -125,6 +125,9 @@ $| = 1; # (Windows only uses this script for miniperl.) @ARGV = eval 'map glob, @ARGV' if $^O eq 'MSWin32'; +my $is_win32 = $^O eq "MSWin32"; +my $is_os2 = $^O eq "os2"; + our $show_elapsed_time = $ENV{HARNESS_TIMER} || 0; # Cheesy version of Getopt::Std. We can't replace it with that, because we @@ -391,7 +394,7 @@ sub _populate_hash { } sub _tests_from_manifest { - my ($extensions, $known_extensions) = @_; + my ($extensions, $known_extensions, $all) = @_; my %skip; my %extensions = _populate_hash($extensions); my %known_extensions = _populate_hash($known_extensions); @@ -402,10 +405,13 @@ sub _tests_from_manifest { } my @results; + my %non_ext; + push @results, \%non_ext if $all; my $mani = '../MANIFEST'; if (open(MANI, $mani)) { while (<MANI>) { - if (m!^((?:cpan|dist|ext)/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) { + my ($file)= split /\t/, $_; + if ($file=~m!^((?:cpan|dist|ext)/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\z!) { my $t = $1; my $extension = $2; @@ -456,6 +462,17 @@ sub _tests_from_manifest { $::path_to_name{$path} = $t; } } + elsif ($file=~m!/(?:test\.pl|[^/\s]+\.t)\z! and $file ne "t/test.pl") { + my $munged = $file; + next if $munged=~m!^(?:t/)?os2/! and !$is_os2; + next if $munged=~m!^(?:t/)?win32/! and !$is_win32; + next if $munged=~m!^(?:t/)?japh/! and !$::torture; + next if $munged=~m!^(?:t/)?benchmark/! and !($::benchmark or $ENV{PERL_BENCHMARK}); + next if $munged=~m!^(?:t/)?bigmem/! and !$ENV{PERL_TEST_MEMORY}; + $munged =~ s!t/!! or $munged = "../$munged"; + + $non_ext{$munged}++; + } } close MANI; } else { @@ -337,7 +337,7 @@ if (@ARGV) { my $which = $ENV{PERL_TEST_HARNESS_ASAP} ? \@last : \@next; push @$which, qw(comp run cmd); - push @$which, qw(io re opbasic op uni mro lib porting perf); + push @$which, qw(io re opbasic op uni mro lib class porting perf test_pl); push @$which, 'japh' if $torture; push @$which, 'win32' if $^O eq 'MSWin32'; push @$which, 'benchmark' if $ENV{PERL_BENCHMARK}; @@ -352,13 +352,26 @@ if (@ARGV) { my $last = { par => '{' . join (',', @last) . '}/*.t' }; @last = _extract_tests ($last); - push @last, - _tests_from_manifest($Config{extensions}, $Config{known_extensions}); - push @tests, @last; + my ($non_ext, @ext_from_manifest)= + _tests_from_manifest($Config{extensions}, $Config{known_extensions}, "all"); + push @last, @ext_from_manifest; + push @seq, _compute_tests_and_ordering(\@last)->@*; + push @tests, @last; $rules = { seq => \@seq }; + + foreach my $test (@tests) { + delete $non_ext->{$test}; + } + + my @in_manifest_but_not_found = sort keys %$non_ext; + if (@in_manifest_but_not_found) { + die "There are test files which are in MANIFEST but are not found by the t/harness\n", + "directory scanning rules. You should update t/harness line 339 or so.\n", + "Files:\n", map { " $_\n" } @in_manifest_but_not_found; + } } } if ($^O eq 'MSWin32') { |