diff options
-rw-r--r-- | Makefile.SH | 1 | ||||
-rw-r--r-- | t/harness | 43 | ||||
-rw-r--r-- | vms/descrip_mms.template | 1 | ||||
-rw-r--r-- | win32/Makefile | 1 | ||||
-rw-r--r-- | win32/Makefile.ce | 1 | ||||
-rw-r--r-- | win32/makefile.mk | 1 |
6 files changed, 41 insertions, 7 deletions
diff --git a/Makefile.SH b/Makefile.SH index 04bdabd687..fa109a880d 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -1098,6 +1098,7 @@ realclean: cleanup_unpacked_files _realcleaner _mopup _clobber: -@rm -f Cross/run-* Cross/to-* Cross/from-* + rm -f t/test_state rm -f config.sh cppstdin Policy.sh extras.lst clobber: cleanup_unpacked_files _realcleaner _mopup _clobber @@ -46,7 +46,7 @@ foreach (keys %datahandle) { 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; @@ -100,7 +100,11 @@ if ($ARGV[0] && $ARGV[0]=~/^-re/) { } } +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); } @@ -123,15 +127,35 @@ if (@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; @@ -171,12 +195,11 @@ if (@ARGV) { 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') { @@ -185,10 +208,16 @@ 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; diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index dfc876e115..5b371c3628 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -1865,6 +1865,7 @@ realclean : clean - 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;* diff --git a/win32/Makefile b/win32/Makefile index 35aa45279f..adf57dcbb5 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1225,6 +1225,7 @@ distclean: realclean -if exist pod2htmd.tmp del pod2htmd.tmp -if exist pod2htmi.tmp del pod2htmi.tmp -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR) + -del /f ..\t\test_state install : all installbare installhtml diff --git a/win32/Makefile.ce b/win32/Makefile.ce index fbca6957c1..4065c9c37a 100644 --- a/win32/Makefile.ce +++ b/win32/Makefile.ce @@ -779,6 +779,7 @@ clean: -rm -f $(MACHINE)/*.lib -rm -f ../config.sh ../lib/Config.pm -rm -f config.h xconfig.h perl.res + -rm -f ../t/test_state XDLLOBJS = \ $(DLLDIR)\av.obj \ diff --git a/win32/makefile.mk b/win32/makefile.mk index 3ef3d0ba07..6ff01a6b48 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1549,6 +1549,7 @@ distclean: realclean -if exist pod2htmd.tmp del pod2htmd.tmp -if exist pod2htmi.tmp del pod2htmi.tmp -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR) + -del /f ..\t\test_state install : all installbare installhtml |