diff options
author | Bram <perl-rt@wizbit.be> | 2008-08-12 22:50:47 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-09-07 22:10:58 +0000 |
commit | cd1b270f9680acd60cc4f1c330aa6df2329d1db7 (patch) | |
tree | 2c2b80400d75424242a02c0da2832187b7fe72c9 /t/harness | |
parent | ea581a515b67cceacd5ceea839a0bff72973e0b1 (diff) | |
download | perl-cd1b270f9680acd60cc4f1c330aa6df2329d1db7.tar.gz |
$ENV{TEST_JOBS} vs $ENV{HARNESS_OPTIONS}
Message-ID: <20080812205047.05lrnmbqlccs08g8@horde.wizbit.be>
p4raw-id: //depot/perl@34314
Diffstat (limited to 't/harness')
-rw-r--r-- | t/harness | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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 { |