diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/TAP/Harness/Env.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/TAP/Harness/Env.pm | 86 |
1 files changed, 76 insertions, 10 deletions
diff --git a/Master/tlpkg/tlperl/lib/TAP/Harness/Env.pm b/Master/tlpkg/tlperl/lib/TAP/Harness/Env.pm index 1a9d7196c40..c565b13bd0d 100644 --- a/Master/tlpkg/tlperl/lib/TAP/Harness/Env.pm +++ b/Master/tlpkg/tlperl/lib/TAP/Harness/Env.pm @@ -7,7 +7,7 @@ use constant IS_VMS => ( $^O eq 'VMS' ); use TAP::Object; use Text::ParseWords qw/shellwords/; -our $VERSION = '3.30'; +our $VERSION = '3.35'; # Get the parts of @INC which are changed from the stock list AND # preserve reordering of stock directories. @@ -91,7 +91,7 @@ sub create { ignore_exit => $ENV{HARNESS_IGNORE_EXIT} || 0, ); - my $class = $ENV{HARNESS_SUBCLASS} || 'TAP::Harness'; + my $class = delete $input{harness_class} || $ENV{HARNESS_SUBCLASS} || 'TAP::Harness'; if ( defined( my $env_opt = $ENV{HARNESS_OPTIONS} ) ) { for my $opt ( split /:/, $env_opt ) { if ( $opt =~ /^j(\d*)$/ ) { @@ -126,24 +126,90 @@ TAP::Harness::Env - Parsing harness related environmental variables where approp =head1 VERSION -Version 3.30 +Version 3.35 =head1 SYNOPSIS - my ($class, $args) = get_test_arguments(); - require_module($class); - $class->new($args); + my $harness = TAP::Harness::Env->create(\%extra_args) =head1 DESCRIPTION -This module implements the environmental variables that L<Test::Harness> for use with TAP::Harness. +This module implements the environmental variables that L<Test::Harness> uses with TAP::Harness, and instantiates the appropriate class with the appropriate arguments. -=head1 FUNCTIONS +=head1 METHODS =over 4 -=item * get_test_options( \%args ) +=item * create( \%args ) -This function reads the environment and generates an appropriate argument hash from it. If given any arguments, there will override the environmental defaults. It will return of C<$class> and C<$args>. +This function reads the environment and generates an appropriate argument hash from it. If given any arguments in C<%extra_args>, these will override the environmental defaults. In accepts C<harness_class> (which defaults to C<TAP::Harness>), and any argument the harness class accepts. + +=back + +=head1 ENVIRONMENTAL VARIABLES + +=over 4 + +=item C<HARNESS_PERL_SWITCHES> + +Setting this adds perl command line switches to each test file run. + +For example, C<HARNESS_PERL_SWITCHES=-T> will turn on taint mode. +C<HARNESS_PERL_SWITCHES=-MDevel::Cover> will run C<Devel::Cover> for +each test. + +=item C<HARNESS_VERBOSE> + +If true, C<TAP::Harness> will output the verbose results of running +its tests. + +=item C<HARNESS_SUBCLASS> + +Specifies a TAP::Harness subclass to be used in place of TAP::Harness. + +=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<< c >> + +Try to color output. See L<TAP::Formatter::Base/"new">. + +=item C<< a<file.tgz> >> + +Will use L<TAP::Harness::Archive> as the harness class, and save the TAP to +C<file.tgz> + +=item C<< fPackage-With-Dashes >> + +Set the formatter_class of the harness being run. Since the C<HARNESS_OPTIONS> +is seperated by C<:>, we use C<-> instead. + +=back + +Multiple options may be separated by colons: + + HARNESS_OPTIONS=j9:c make test + +=item C<HARNESS_TIMER> + +Setting this to true will make the harness display the number of +milliseconds each test took. You can also use F<prove>'s C<--timer> +switch. + +=item C<HARNESS_COLOR> + +Attempt to produce color output. + +=item C<HARNESS_IGNORE_EXIT> + +If set to a true value instruct C<TAP::Parser> to ignore exit and wait +status from test scripts. =back |