X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fharness;h=a70c8be311e69550daffe0182a83cb2590caf975;hb=6d1e6673d7386f4f9139111a6e44d555b8252741;hp=11c174148da79c2eea974daab3de5da6965324cf;hpb=c537bcda150384467d5ff232f1f1b27075e03c5b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/harness b/t/harness index 11c1741..a70c8be 100644 --- a/t/harness +++ b/t/harness @@ -8,8 +8,6 @@ BEGIN { @INC = '../lib'; # pick up only this build's lib } -delete $ENV{PERL5LIB}; - my $torture; # torture testing? use TAP::Harness 3.13; @@ -129,7 +127,7 @@ if (@ARGV) { unless (@tests) { my @seq = ; - my @next = qw(comp run cmd io op uni mro lib porting); + my @next = qw(comp run cmd io re op uni mro lib porting); push @next, 'japh' if $torture; push @next, 'win32' if $^O eq 'MSWin32'; push @next, 'benchmark' if $ENV{PERL_BENCHMARK}; @@ -203,11 +201,29 @@ if ($^O eq 'MSWin32') { @tests=grep /$re/, @tests if $re; +my %options; + +my $type = 'perl'; + +# Load TAP::Parser now as otherwise it could be required in the short time span +# in which the harness process chdirs into ext/Dist +require TAP::Parser; + my $h = TAP::Harness->new({ rules => $rules, color => $color, jobs => $jobs, verbosity => $Verbose, + exec => sub { + my ($harness, $test) = @_; + + my $options = $options{$test}; + if (!defined $options) { + $options = $options{$test} = _scan_test($test, $type); + } + + return [ split ' ', _cmd($options, $type) ]; + }, }); if ($state) { @@ -225,9 +241,21 @@ if ($state) { $h->callback( parser_args => sub { - my ( $args, $test ) = @_; - push @{ $args->{switches} }, '-I../lib'; + my ($args, $job) = @_; + my $test = $job->[0]; + _before_fork($options{$test}); + push @{ $args->{switches} }, "-I../../lib"; + } + ); + +$h->callback( + made_parser => sub { + my ($parser, $job) = @_; + my $test = $job->[0]; + my $options = delete $options{$test}; + _after_fork($options); } ); + $h->runtests(@tests); exit(0);