X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fharness;h=e6e8d9e8f18c7522a221795cc70eb6b17890a50f;hb=28b1daef84496f2ebce3fad4ac7861dd4dd92f38;hp=8a4e9b4c3a8e50d21636a46c8101e11b94b3fa87;hpb=0279961e65f24cb3d5407ae9771030dcc5eb6882;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/harness b/t/harness index 8a4e9b4..e6e8d9e 100644 --- a/t/harness +++ b/t/harness @@ -101,7 +101,23 @@ if ($ARGV[0] && $ARGV[0]=~/^-re/) { } my $jobs = $ENV{TEST_JOBS}; -my ($rules, $state); +my ($fork, $rules, $state); +if ($ENV{HARNESS_OPTIONS}) { + for my $opt ( split /:/, $ENV{HARNESS_OPTIONS} ) { + if ( $opt =~ /^j(\d*)$/ ) { + $jobs ||= $1 || 9; + } + elsif ( $opt eq 'f' ) { + $fork = 1; + } + elsif ( $opt eq 'c' ) { +# $args->{color} = 1; + } + else { + die "Unknown HARNESS_OPTIONS item: $opt\n"; + } + } +} if (@ARGV) { # If you want these run in speed order, just use prove @@ -210,7 +226,10 @@ if ($^O eq 'MSWin32') { if ($jobs) { eval 'use TAP::Harness 3.13; 1' or die $@; - my $h = TAP::Harness->new({ jobs => $jobs, rules => $rules}); + + # Test::Harness parses $ENV{HARNESS_OPTIONS}, TAP::Harness does not + local $ENV{HARNESS_OPTIONS}; + my $h = TAP::Harness->new({ jobs => $jobs, rules => $rules, ($fork ? (fork => $fork) : ())}); if ($state) { $h->callback( after_test => sub {