Permalink
Browse files

Tagged 3.02, version bump

  • Loading branch information...
1 parent 5bb8acd commit 82608bccd75f44db630df0bb7d05c7e53941391b @AndyA AndyA committed Nov 16, 2007
Showing with 81 additions and 35 deletions.
  1. +7 −0 Changes
  2. +1 −30 META.yml
  3. +1 −1 lib/TAP/Harness.pm
  4. +72 −4 lib/Test/Harness.pm
View
@@ -1,5 +1,12 @@
Revision history for Test-Harness
+3.02 2007-11-15
+ - Process I/O now unbuffered, uses sysread, plays better with
+ select. Fixes #30740.
+ - Made Test::Harness @INC propagation more compatible with 2.64.
+ Was breaking Parrot's test suite.
+ - Added HARNESS_OPTIONS (#30676)
+
3.01 2007-11-12
- Fix for RHEL incpush.patch related failure.
- Output real time of test completion with --timer
View
@@ -1,7 +1,6 @@
---
name: Test-Harness
version: 3.02
-
author:
- 'Andy Armstrong C<< <andy@hexten.net> >>'
abstract: Run Perl standard test scripts with statistics
@@ -20,116 +19,88 @@ provides:
App::Prove:
file: lib/App/Prove.pm
version: 3.02
-
TAP::Base:
file: lib/TAP/Base.pm
version: 3.02
-
TAP::Formatter::Color:
file: lib/TAP/Formatter/Color.pm
version: 3.02
-
TAP::Formatter::Console:
file: lib/TAP/Formatter/Console.pm
version: 3.02
-
TAP::Formatter::Console::ParallelSession:
file: lib/TAP/Formatter/Console/ParallelSession.pm
version: 3.02
-
TAP::Formatter::Console::Session:
file: lib/TAP/Formatter/Console/Session.pm
version: 3.02
-
TAP::Harness:
file: lib/TAP/Harness.pm
version: 3.02
-
TAP::Parser:
file: lib/TAP/Parser.pm
version: 3.02
-
TAP::Parser::Aggregator:
file: lib/TAP/Parser/Aggregator.pm
version: 3.02
-
TAP::Parser::Grammar:
file: lib/TAP/Parser/Grammar.pm
version: 3.02
-
TAP::Parser::Iterator:
file: lib/TAP/Parser/Iterator.pm
version: 3.02
-
TAP::Parser::Iterator::Array:
file: lib/TAP/Parser/Iterator/Array.pm
version: 3.02
-
TAP::Parser::Iterator::Process:
file: lib/TAP/Parser/Iterator/Process.pm
version: 3.02
-
TAP::Parser::Iterator::Stream:
file: lib/TAP/Parser/Iterator/Stream.pm
version: 3.02
-
TAP::Parser::Multiplexer:
file: lib/TAP/Parser/Multiplexer.pm
version: 3.02
-
TAP::Parser::Result:
file: lib/TAP/Parser/Result.pm
version: 3.02
-
TAP::Parser::Result::Bailout:
file: lib/TAP/Parser/Result/Bailout.pm
version: 3.02
-
TAP::Parser::Result::Comment:
file: lib/TAP/Parser/Result/Comment.pm
version: 3.02
-
TAP::Parser::Result::Plan:
file: lib/TAP/Parser/Result/Plan.pm
version: 3.02
-
TAP::Parser::Result::Test:
file: lib/TAP/Parser/Result/Test.pm
version: 3.02
-
TAP::Parser::Result::Unknown:
file: lib/TAP/Parser/Result/Unknown.pm
version: 3.02
-
TAP::Parser::Result::Version:
file: lib/TAP/Parser/Result/Version.pm
version: 3.02
-
TAP::Parser::Result::YAML:
file: lib/TAP/Parser/Result/YAML.pm
version: 3.02
-
TAP::Parser::Source:
file: lib/TAP/Parser/Source.pm
version: 3.02
-
TAP::Parser::Source::Perl:
file: lib/TAP/Parser/Source/Perl.pm
version: 3.02
-
TAP::Parser::YAMLish::Reader:
file: lib/TAP/Parser/YAMLish/Reader.pm
version: 3.02
-
TAP::Parser::YAMLish::Writer:
file: lib/TAP/Parser/YAMLish/Writer.pm
version: 3.02
-
Test::Harness:
file: lib/Test/Harness.pm
version: 3.02
-
-generated_by: Module::Build version 0.280801
+generated_by: Module::Build version 0.2808
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2
View
@@ -178,7 +178,7 @@ Typically, Perl tests are run through this. However, anything which spits out
TAP is fine. You can use this argument to specify the name of the program
(and optional switches) to run your tests with:
- exec => '/usr/bin/ruby -w'
+ exec => ['/usr/bin/ruby', '-w']
=item * C<merge>
View
@@ -10,6 +10,7 @@ use constant IS_VMS => ( $^O eq 'VMS' );
use TAP::Harness ();
use TAP::Parser::Aggregator ();
+use Config;
use Exporter;
# TODO: Emulate at least some of these
@@ -107,6 +108,38 @@ one of the messages in the DIAGNOSTICS section.
=cut
+sub _aggregate {
+ my ( $harness, $aggregate, @tests ) = @_;
+
+ # Don't propagate to our children
+ local $ENV{HARNESS_OPTIONS};
+
+ if (IS_VMS) {
+
+ # Jiggery pokery doesn't appear to work on VMS - so disable it
+ # pending investigation.
+ $harness->aggregate_tests( $aggregate, @tests );
+ }
+ else {
+ my $path_sep = $Config{path_sep};
+ my $path_pat = qr{$path_sep};
+ my @extra_inc = _filtered_inc();
+
+ my $previous = $ENV{PERL5LIB};
+ local $ENV{PERL5LIB};
+
+ if ($previous) {
+ push @extra_inc, split( $path_pat, $previous );
+ }
+
+ if (@extra_inc) {
+ $ENV{PERL5LIB} = join( $path_sep, @extra_inc );
+ }
+
+ $harness->aggregate_tests( $aggregate, @tests );
+ }
+}
+
sub runtests {
my @tests = @_;
@@ -116,7 +149,7 @@ sub runtests {
my $harness = _new_harness();
my $aggregate = TAP::Parser::Aggregator->new();
- $harness->aggregate_tests( $aggregate, @tests );
+ _aggregate( $harness, $aggregate, @tests );
$harness->formatter->summary($aggregate);
@@ -176,7 +209,8 @@ sub _new_harness {
}
}
- push @lib, _filtered_inc();
+ # Do things the old way on VMS...
+ push @lib, _filtered_inc() if IS_VMS;
my $args = {
timer => $Timer,
@@ -186,13 +220,27 @@ sub _new_harness {
verbosity => $Verbose,
};
+ if ( defined( my $env_opt = $ENV{HARNESS_OPTIONS} ) ) {
+ for my $opt ( split /:/, $env_opt ) {
+ if ( $opt =~ /^j(\d*)$/ ) {
+ $args->{jobs} = $1 || 9;
+ }
+ elsif ( $opt eq 'f' ) {
+ $args->{fork} = 1;
+ }
+ else {
+ die "Unknown HARNESS_OPTIONS item: $opt\n";
+ }
+ }
+ }
+
return TAP::Harness->new($args);
}
# Get the parts of @INC which are changed from the stock list AND
# preserve reordering of stock directories.
sub _filtered_inc {
- my @inc = grep { !ref } @INC; #28567
+ my @inc = grep { !ref } @INC; #28567
if (IS_VMS) {
@@ -289,7 +337,7 @@ sub execute_tests {
}
);
- $harness->aggregate_tests( $aggregate, @{ $args{tests} } );
+ _aggregate( $harness, $aggregate, @{ $args{tests} } );
$tot{bench} = $aggregate->elapsed;
my @tests = $aggregate->descriptions;
@@ -454,6 +502,26 @@ If true, C<Test::Harness> will output the verbose results of running
its tests. Setting C<$Test::Harness::verbose> will override this,
or you can use the C<-v> switch in the F<prove> utility.
+=item C<HARNESS_OPTIONS>
+
+Provide additional options to the harness. Currently supported options are:
+
+=over
+
+=item C<< j<n> >>
+
+Run <n> (default 9) parallel jobs.
+
+=item C<< f >>
+
+Use forked parallelism.
+
+=back
+
+Multiple options may be separated by colons:
+
+ HARNESS_OPTIONS=j9:f make test
+
=back
=head1 SEE ALSO

0 comments on commit 82608bc

Please sign in to comment.