- push @tests, <base/*.t>;
- push @tests, <comp/*.t>;
- push @tests, <cmd/*.t>;
- push @tests, <run/*.t>;
- push @tests, <io/*.t>;
- push @tests, <op/*.t>;
- push @tests, <uni/*.t>;
- push @tests, <lib/*.t>;
- push @tests, <win32/*.t> if $^O eq 'MSWin32';
- use File::Spec;
- my $updir = File::Spec->updir;
- my $mani = File::Spec->catfile(File::Spec->updir, "MANIFEST");
- if (open(MANI, $mani)) {
- while (<MANI>) { # similar code in t/TEST
- if (m!^(ext/\S+/?([^/]+\.t|test\.pl)|lib/\S+?(\.t|test\.pl))\s!) {
- push @tests, File::Spec->catfile($updir, $1);
- }
+ my @seq = <base/*.t>;
+
+ my @next = qw(comp run cmd io re opbasic op uni mro lib porting perf);
+ push @next, 'japh' if $torture;
+ push @next, 'win32' if $^O eq 'MSWin32';
+ push @next, 'benchmark' if $ENV{PERL_BENCHMARK};
+ push @next, 'bigmem' if $ENV{PERL_TEST_MEMORY};
+ # Hopefully TAP::Parser::Scheduler will support this syntax soon.
+ # my $next = { par => '{' . join (',', @next) . '}/*.t' };
+ my $next = { par => [
+ map { "$_/*.t" } @next
+ ] };
+ @tests = _extract_tests ($next);
+
+ # This is a bit of a game, because we only want to sort these tests in
+ # speed order. base/*.t wants to run first, and ext,lib etc last and in
+ # MANIFEST order
+ if ($jobs) {
+ require App::Prove::State;
+ $state = App::Prove::State->new({ store => 'test_state' });
+ $state->apply_switch('slow', 'save');
+ # For some reason get_tests returns *all* the tests previously run,
+ # (in the right order), not simply the selection in @tests
+ # (in the right order). Not sure if this is a bug or a feature.
+ # Whatever, *we* are only interested in the ones that are in @tests
+ my %seen;
+ @seen{@tests} = ();
+ @tests = grep {exists $seen{$_} } $state->get_tests(0, @tests);
+ }
+ @tests = (@seq, @tests);
+ push @seq, $next;
+
+ my @last;
+ push @last, sort { lc $a cmp lc $b }
+ _tests_from_manifest($Config{extensions}, $Config{known_extensions});
+ my %times;
+ if ($state) {
+ # Where known, collate the elapsed times by test name
+ foreach ($state->results->tests()) {
+ $times{$_->name} = $_->elapsed();