unlink "$_.t";
}
-my (@tests, $rules, $re);
+my (@tests, $re);
# [.VMS]TEST.COM calls harness with empty arguments, so clean-up @ARGV
@ARGV = grep $_ && length( $_ ) => @ARGV;
}
}
+my $jobs = $ENV{TEST_JOBS};
+my ($rules, $state);
+
if (@ARGV) {
+ # If you want these run in speed order, just use prove
if ($^O eq 'MSWin32') {
@tests = map(glob($_),@ARGV);
}
# nice to get the tests in t/op/*.t able to run in parallel.
unless (@tests) {
- my @seq;
- push @seq, <base/*.t>;
+ my @seq = <base/*.t>;
my @next = qw(comp cmd run io op uni mro lib);
push @next, 'japh' if $torture;
push @next, 'win32' if $^O eq 'MSWin32';
- push @seq, { par => [
+ # 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;
use Config;
push @last, <pod/*.t>;
push @last, <x2p/*.t>;
- @tests = (_extract_tests (@seq), @last);
+ push @tests, @last;
push @seq, _seq_dir_rules @last;
$rules = { seq => \@seq };
-
}
}
if ($^O eq 'MSWin32') {
@tests=grep /$re/, @tests
if $re;
-my $jobs = $ENV{TEST_JOBS};
if ($jobs) {
eval 'use TAP::Harness 3.13; 1' or die $@;
my $h = TAP::Harness->new({ jobs => $jobs, rules => $rules});
+ if ($state) {
+ $h->callback(
+ after_test => sub {
+ $state->observe_test(@_);
+ }
+ );
+ }
$h->runtests(@tests);
} else {
Test::Harness::runtests @tests;
- If F$Search("[...]*$(E)").nes."" Then Delete/NoConfirm/Log [...]*$(E);*
- If F$Search("[.vms]Perl_Setup.Com").nes."" Then Delete/NoConfirm/Log [.vms]Perl_Setup.Com;*
- If F$Search("[.t]rantests.").nes."" Then Delete/NoConfirm/Log [.t]rantests.;*
+ - If F$Search("[.t]test_state.").nes."" Then Delete/NoConfirm/Log [.t]test_state.;*
- If F$Search("[.t.lib]vmsfspec.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vmsfspec.t;*
- If F$Search("[.t.lib]vmsish.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vmsish.t;*
- If F$Search("[.t.lib]vms_dclsym.t").nes."" Then Delete/NoConfirm/Log [.t.lib]vms_dclsym.t;*