This includes the blead CUSTOMIZATION of t/source.t.
cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Formatter/Session.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Harness/Beyond.pod
+cpan/Test-Harness/lib/TAP/Harness/Env.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Harness.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Object.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm
cpan/Test-Harness/lib/TAP/Parser/Source.pm A parser for Test Anything Protocol
-cpan/Test-Harness/lib/TAP/Parser/Utils.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm A parser for Test Anything Protocol
cpan/Test-Harness/lib/Test/Harness.pm A test harness
cpan/Test-Harness/t/taint.t Test::Harness test
cpan/Test-Harness/t/testargs.t Test::Harness test
cpan/Test-Harness/t/unicode.t Test::Harness test
-cpan/Test-Harness/t/utils.t Test::Harness test
cpan/Test-Harness/t/yamlish-output.t Test::Harness test
cpan/Test-Harness/t/yamlish.t Test::Harness test
cpan/Test-Harness/t/yamlish-writer.t Test::Harness test
},
'Test::Harness' => {
- 'DISTRIBUTION' => 'OVID/Test-Harness-3.28.tar.gz',
+ 'DISTRIBUTION' => 'OVID/Test-Harness-3.29.tar.gz',
'FILES' => q[cpan/Test-Harness],
'EXCLUDED' => [
qr{^examples/},
t/lib/if.pm
),
],
-
- # Waiting to be merged upstream: see CPAN RT#64353
- 'CUSTOMIZED' => [ 't/source.t' ],
-
'UPSTREAM' => 'cpan',
},
Revision history for Test-Harness
+3.29 2013-08-10
+ - Get rid of use vars in favor of our in all modules (Leon Timmermans)
+ and tests (Karen Etheridge)
+ - Added use warnings to all modules (Leon Timmermans) and tests (Karen
+ Etheridge)
+ - Use parent instead of @ISA in all modules (Leon Timmermans) and
+ tests (Karen Etheridge)
+ - Fix failing test on VMS (Craig Berry)
+ - Improve error message on loading failure (Leon Timmermans, #77730)
+ - Use Text::ParseWords, deprecate TAP::Parser::Utils
+
3.28 2013-05-02
- Bugfix: Fix taint failures on Windows (Jan Dubois)
Reduces memory usage (Nick Clark, RT #84939)
- PERL5LIB is always propogated to a test's @INC, even with taint more
(Schwern, RT #84377)
+ - restore "always add -w to switches" behavior
3.26 2013-01-16
- Renamed env.opts.t to env_opts.t (for VMS)
test more gracefully.
- Make the test summary 'ok' line overrideable so that it can be
changed to a plugin to make the output of prove idempotent.
+ - Stop adding '-w' to perl switches by default
- Apply upstream patch:
http://perl5.git.perl.org/perl.git/commit \
as process IDs, as there's a race condition to break into the account running
perl's tests.
+
3.23 2011-02-20
- Merge in changes from core. Thanks BinGOs.
- Made SourceHandler understand that an executable binary file
lib/TAP/Formatter/Session.pm
lib/TAP/Harness.pm
lib/TAP/Harness/Beyond.pod
+lib/TAP/Harness/Env.pm
lib/TAP/Object.pm
lib/TAP/Parser.pm
lib/TAP/Parser/Aggregator.pm
lib/TAP/Parser/SourceHandler/Handle.pm
lib/TAP/Parser/SourceHandler/Perl.pm
lib/TAP/Parser/SourceHandler/RawTAP.pm
-lib/TAP/Parser/Utils.pm
lib/TAP/Parser/YAMLish/Reader.pm
lib/TAP/Parser/YAMLish/Writer.pm
lib/Test/Harness.pm
t/taint.t
t/testargs.t
t/unicode.t
-t/utils.t
t/yamlish-output.t
t/yamlish-writer.t
t/yamlish.t
#!/usr/bin/perl -w
use strict;
+use warnings;
use App::Prove;
my $app = App::Prove->new;
be specified multiple times, and the order matters.
The most practical use is likely to specify that some tests are not
-"parallel-ready". Since mentioning a file with --rules doens't cause it to
+"parallel-ready". Since mentioning a file with --rules doesn't cause it to
selected to run as a test, you can "set and forget" some rules preferences in
your .proverc file. Then you'll be able to take maximum advantage of the
performance benefits of parallel testing, while some exceptions are still run
=head3 --rules resolution
-=over4
+=over 4
=item * By default, all tests are eligible to be run in parallel. Specifying any of your own rules removes this one.
package App::Prove;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
use TAP::Harness;
-use TAP::Parser::Utils qw( split_shell );
+use Text::ParseWords qw(shellwords);
use File::Spec;
use Getopt::Long;
use App::Prove::State;
use Carp;
+use parent 'TAP::Object';
+
=head1 NAME
App::Prove - Implements the C<prove> command.
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
my @ATTR;
BEGIN {
- @ISA = qw(TAP::Object);
-
@ATTR = qw(
archive argv blib show_count color directives exec failures comments
formatter harness includes modules plugins jobs lib merge parse quiet
push @switches, '-w';
}
- push @switches, split_shell( $ENV{HARNESS_PERL_SWITCHES} );
+ push @switches, shellwords( $ENV{HARNESS_PERL_SWITCHES} ) if defined $ENV{HARNESS_PERL_SWITCHES};
return @switches ? \@switches : ();
}
package App::Prove::State;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
use File::Find;
use File::Spec;
use App::Prove::State::Result;
use TAP::Parser::YAMLish::Reader ();
use TAP::Parser::YAMLish::Writer ();
-use TAP::Base;
+use parent 'TAP::Base';
BEGIN {
- @ISA = qw( TAP::Base );
__PACKAGE__->mk_methods('result_class');
}
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package App::Prove::State::Result;
use strict;
+use warnings;
use Carp 'croak';
use App::Prove::State::Result::Test;
-use vars qw($VERSION);
use constant STATE_VERSION => 1;
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package App::Prove::State::Result::Test;
use strict;
-
-use vars qw($VERSION);
+use warnings;
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Base;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object;
-
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
use constant GOT_TIME_HIRES => do {
eval 'use Time::HiRes qw(time);';
package TAP::Whatever;
- use TAP::Base;
-
- use vars qw($VERSION @ISA);
- @ISA = qw(TAP::Base);
+ use parent 'TAP::Base';
# ... later ...
package TAP::Formatter::Base;
use strict;
-use TAP::Base ();
+use warnings;
+use parent 'TAP::Base';
use POSIX qw(strftime);
-use vars qw($VERSION @ISA);
-
my $MAX_ERRORS = 5;
my %VALIDATION_FOR;
BEGIN {
- @ISA = qw(TAP::Base);
-
%VALIDATION_FOR = (
directives => sub { shift; shift },
verbosity => sub { shift; shift },
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Formatter::Color;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
use constant IS_WIN32 => ( $^O =~ /^(MS)?Win32$/ );
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
my $NO_COLOR;
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Formatter::Console;
use strict;
-use TAP::Formatter::Base ();
+use warnings;
+use parent 'TAP::Formatter::Base';
use POSIX qw(strftime);
-use vars qw($VERSION @ISA);
-
-@ISA = qw(TAP::Formatter::Base);
-
=head1 NAME
TAP::Formatter::Console - Harness output delegate for default console output
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
}
}
+sub _failure_color {
+ my ($self) = @_;
+
+ return $ENV{'HARNESS_SUMMARY_COLOR_FAIL'} || 'red';
+}
+
+sub _success_color {
+ my ($self) = @_;
+
+ return $ENV{'HARNESS_SUMMARY_COLOR_SUCCESS'} || 'green';
+}
+
sub _output_success {
my ( $self, $msg ) = @_;
- $self->_set_colors('green');
+ $self->_set_colors( $self->_success_color() );
$self->_output($msg);
$self->_set_colors('reset');
}
sub _failure_output {
my $self = shift;
- $self->_set_colors('red');
+ $self->_set_colors( $self->_failure_color() );
my $out = join '', @_;
my $has_newline = chomp $out;
$self->_output($out);
package TAP::Formatter::Console::ParallelSession;
use strict;
+use warnings;
use File::Spec;
use File::Path;
-use TAP::Formatter::Console::Session;
use Carp;
-use constant WIDTH => 72; # Because Eric says
-use vars qw($VERSION @ISA);
+use parent 'TAP::Formatter::Console::Session';
-@ISA = qw(TAP::Formatter::Console::Session);
+use constant WIDTH => 72; # Because Eric says
my %shared;
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Formatter::Console::Session;
use strict;
-use TAP::Formatter::Session;
+use warnings;
-use vars qw($VERSION @ISA);
-
-@ISA = qw(TAP::Formatter::Session);
+use parent 'TAP::Formatter::Session';
my @ACCESSOR;
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Formatter::File;
use strict;
-use TAP::Formatter::Base ();
+use warnings;
use TAP::Formatter::File::Session;
use POSIX qw(strftime);
-use vars qw($VERSION @ISA);
-
-@ISA = qw(TAP::Formatter::Base);
+use parent 'TAP::Formatter::Base';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Formatter::File::Session;
use strict;
-use TAP::Formatter::Session;
-
-use vars qw($VERSION @ISA);
-
-@ISA = qw(TAP::Formatter::Session);
+use warnings;
+use parent 'TAP::Formatter::Session';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Formatter::Session;
use strict;
-use TAP::Base;
+use warnings;
-use vars qw($VERSION @ISA);
-
-@ISA = qw(TAP::Base);
+use parent 'TAP::Base';
my @ACCESSOR;
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 METHODS
package TAP::Harness;
use strict;
+use warnings;
use Carp;
use File::Spec;
use File::Path;
use IO::Handle;
-use TAP::Base;
-
-use vars qw($VERSION @ISA);
-
-@ISA = qw(TAP::Base);
+use parent 'TAP::Base';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
$ENV{HARNESS_ACTIVE} = 1;
$ENV{HARNESS_VERSION} = $VERSION;
If set, C<sources> must be a hashref containing the names of the
L<TAP::Parser::SourceHandler>s to load and/or configure. The values are a
-hash of configuration that will be accessible to to the source handlers via
+hash of configuration that will be accessible to the source handlers via
L<TAP::Parser::Source/config_for>.
For example:
+=head1 NAME
+
+Test::Harness - Beyond make test
+
=head1 Beyond make test
Test::Harness is responsible for running test scripts, analysing
package My::TAP::Harness;
- use base qw( TAP::Harness ); use YAML;
+ use parent 'TAP::Harness';
+ use YAML;
sub summary {
my ( $self, $aggregate ) = @_;
--- /dev/null
+package TAP::Harness::Env;
+
+use strict;
+use warnings;
+
+use constant IS_VMS => ( $^O eq 'VMS' );
+use TAP::Object;
+use Text::ParseWords qw/shellwords/;
+
+our $VERSION = '3.29';
+
+# Get the parts of @INC which are changed from the stock list AND
+# preserve reordering of stock directories.
+sub _filtered_inc_vms {
+ my @inc = grep { !ref } @INC; #28567
+
+ # VMS has a 255-byte limit on the length of %ENV entries, so
+ # toss the ones that involve perl_root, the install location
+ @inc = grep { !/perl_root/i } @inc;
+
+ my @default_inc = _default_inc();
+
+ my @new_inc;
+ my %seen;
+ for my $dir (@inc) {
+ next if $seen{$dir}++;
+
+ if ( $dir eq ( $default_inc[0] || '' ) ) {
+ shift @default_inc;
+ }
+ else {
+ push @new_inc, $dir;
+ }
+
+ shift @default_inc while @default_inc and $seen{ $default_inc[0] };
+ }
+ return @new_inc;
+}
+
+# Cache this to avoid repeatedly shelling out to Perl.
+my @inc;
+
+sub _default_inc {
+ return @inc if @inc;
+
+ local $ENV{PERL5LIB};
+ local $ENV{PERLLIB};
+
+ my $perl = $ENV{HARNESS_PERL} || $^X;
+
+ # Avoid using -l for the benefit of Perl 6
+ chomp( @inc = `"$perl" -e "print join qq[\\n], \@INC, q[]"` );
+ return @inc;
+}
+
+sub create {
+ my $package = shift;
+ my %input = %{ shift || {} };
+
+ my @libs = @{ delete $input{libs} || [] };
+ my @raw_switches = @{ delete $input{switches} || [] };
+ my @opt
+ = ( @raw_switches, shellwords( $ENV{HARNESS_PERL_SWITCHES} || '' ) );
+ my @switches;
+ while ( my $opt = shift @opt ) {
+ if ( $opt =~ /^ -I (.*) $ /x ) {
+ push @libs, length($1) ? $1 : shift @opt;
+ }
+ else {
+ push @switches, $opt;
+ }
+ }
+
+ # Do things the old way on VMS...
+ push @libs, _filtered_inc_vms() if IS_VMS;
+
+ # If $Verbose isn't numeric default to 1. This helps core.
+ my $verbose
+ = $ENV{HARNESS_VERBOSE}
+ ? $ENV{HARNESS_VERBOSE} !~ /\d/
+ ? 1
+ : $ENV{HARNESS_VERBOSE}
+ : 0;
+
+ my %args = (
+ lib => \@libs,
+ timer => $ENV{HARNESS_TIMER} || 0,
+ switches => \@switches,
+ color => $ENV{HARNESS_COLOR} || 0,
+ verbosity => $verbose,
+ ignore_exit => $ENV{HARNESS_IGNORE_EXIT} || 0,
+ );
+
+ my $class = $ENV{HARNESS_SUBCLASS} || 'TAP::Harness';
+ 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 'c' ) {
+ $args{color} = 1;
+ }
+ elsif ( $opt =~ m/^f(.*)$/ ) {
+ my $fmt = $1;
+ $fmt =~ s/-/::/g;
+ $args{formatter_class} = $fmt;
+ }
+ elsif ( $opt =~ m/^a(.*)$/ ) {
+ my $archive = $1;
+ $class = 'TAP::Harness::Archive';
+ $args{archive} = $archive;
+ }
+ else {
+ die "Unknown HARNESS_OPTIONS item: $opt\n";
+ }
+ }
+ }
+ return TAP::Object->_construct($class, { %args, %input });
+}
+
+1;
+
+=head1 NAME
+
+TAP::Harness::Env - Parsing harness related environmental variables where appropriate
+
+=head1 VERSION
+
+Version 3.29
+
+=head1 SYNOPSIS
+
+ my ($class, $args) = get_test_arguments();
+ require_module($class);
+ $class->new($args);
+
+=head1 DESCRIPTION
+
+This module implements the environmental variables that L<Test::Harness> for use with TAP::Harness.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item * get_test_options( \%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>.
+
+=back
package TAP::Object;
use strict;
-use vars qw($VERSION);
+use warnings;
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Whatever;
use strict;
- use vars qw(@ISA);
- use TAP::Object;
-
- @ISA = qw(TAP::Object);
+ use parent 'TAP::Object';
# new() implementation by TAP::Object
sub _initialize {
unless ( $class->can('new') ) {
local $@;
eval "require $class";
- $self->_croak("Can't load $class") if $@;
+ $self->_croak("Can't load $class: $@") if $@;
}
return $class->new(@args);
package TAP::Parser;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Base ();
use TAP::Parser::Grammar ();
use TAP::Parser::Result ();
use TAP::Parser::ResultFactory ();
use Carp qw( confess );
+use parent 'TAP::Base';
+
+=encoding utf8
+
=head1 NAME
TAP::Parser - Parse L<TAP|Test::Harness::TAP> output
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
my $DEFAULT_TAP_VERSION = 12;
my $MAX_TAP_VERSION = 13;
}
BEGIN { # making accessors
- @ISA = qw(TAP::Base);
-
__PACKAGE__->mk_methods(
qw(
_iterator
If set, C<sources> must be a hashref containing the names of the
L<TAP::Parser::SourceHandler>s to load and/or configure. The values are a
-hash of configuration that will be accessible to to the source handlers via
+hash of configuration that will be accessible to the source handlers via
L<TAP::Parser::Source/config_for>.
For example:
Returns a list of pragmas each of which is a + or - followed by the
pragma name.
-
+
=head2 C<comment> methods
if ( $result->is_comment ) { ... }
If you just need to customize the objects on creation, subclass L<TAP::Parser>
and override L</make_iterator_factory>.
-Note that L</make_source> & L</make_perl_source> have been I<DEPRECATED> and
+Note that C<make_source> & C<make_perl_source> have been I<DEPRECATED> and
are now removed.
=head3 Iterators
package TAP::Parser::Aggregator;
use strict;
+use warnings;
use Benchmark;
-use vars qw($VERSION @ISA);
-use TAP::Object ();
-
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Grammar;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
use TAP::Parser::ResultFactory ();
use TAP::Parser::YAMLish::Reader ();
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Iterator;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
-
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
# to subclass:
- use vars qw(@ISA);
use TAP::Parser::Iterator ();
- @ISA = qw(TAP::Parser::Iterator);
+ use parent 'TAP::Parser::Iterator';
sub _initialize {
# see TAP::Object...
}
package TAP::Parser::Iterator::Array;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::Iterator ();
-
-@ISA = 'TAP::Parser::Iterator';
+use parent 'TAP::Parser::Iterator';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Iterator::Process;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::Iterator ();
use Config;
use IO::Handle;
-@ISA = 'TAP::Parser::Iterator';
+use parent 'TAP::Parser::Iterator';
my $IS_WIN32 = ( $^O =~ /^(MS)?Win32$/ );
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
{
- local $^W; # no warnings
+ no warnings 'uninitialized';
# get around a catch22 in the test suite that causes failures on Win32:
local $SIG{__DIE__} = undef;
eval { require POSIX; &POSIX::WEXITSTATUS(0) };
# HOTPATCH {{{
my $xclose = \&IPC::Open3::xclose;
- local $^W; # no warnings
+ no warnings;
local *IPC::Open3::xclose = sub {
my $fh = shift;
no strict 'refs';
package TAP::Parser::Iterator::Stream;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::Iterator ();
-
-@ISA = 'TAP::Parser::Iterator';
+use parent 'TAP::Parser::Iterator';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::IteratorFactory;
use strict;
-use vars qw($VERSION @ISA);
-
-use TAP::Object ();
+use warnings;
use Carp qw( confess );
use File::Basename qw( fileparse );
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
use constant handlers => [];
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package MyIteratorFactory;
use strict;
- use vars '@ISA';
-
- use TAP::Parser::IteratorFactory;
- @ISA = qw( TAP::Parser::IteratorFactory );
+ use parent 'TAP::Parser::IteratorFactory';
# override source detection algorithm
sub detect_source {
package TAP::Parser::Multiplexer;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
use IO::Select;
-use TAP::Object ();
+
+use parent 'TAP::Object';
use constant IS_WIN32 => $^O =~ /^(MS)?Win32$/;
use constant IS_VMS => $^O eq 'VMS';
use constant SELECT_OK => !( IS_VMS || IS_WIN32 );
-@ISA = 'TAP::Object';
-
=head1 NAME
TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Result;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
-
-@ISA = 'TAP::Object';
+use parent 'TAP::Object';
BEGIN {
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package MyResult;
use strict;
- use vars '@ISA';
- @ISA = 'TAP::Parser::Result';
+ use parent 'TAP::Parser::Result';
# register with the factory:
TAP::Parser::ResultFactory->register_type( 'my_type' => __PACKAGE__ );
package TAP::Parser::Result::Bailout;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::Comment;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::Plan;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::Pragma;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::Test;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
-
-use vars qw($VERSION);
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::Unknown;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
-
-use vars qw($VERSION);
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::Version;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::Result::YAML;
use strict;
+use warnings;
-use vars qw($VERSION @ISA);
-use TAP::Parser::Result;
-@ISA = 'TAP::Parser::Result';
+use parent 'TAP::Parser::Result';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 DESCRIPTION
package TAP::Parser::ResultFactory;
use strict;
-use vars qw($VERSION @ISA %CLASS_FOR);
+use warnings;
-use TAP::Object ();
use TAP::Parser::Result::Bailout ();
use TAP::Parser::Result::Comment ();
use TAP::Parser::Result::Plan ();
use TAP::Parser::Result::Version ();
use TAP::Parser::Result::YAML ();
-@ISA = 'TAP::Object';
+use parent 'TAP::Object';
##############################################################################
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head2 DESCRIPTION
# create a custom result type:
package MyResult;
use strict;
- use vars qw(@ISA);
- @ISA = 'TAP::Parser::Result';
+ use parent 'TAP::Parser::Result';
# register with the factory:
TAP::Parser::ResultFactory->register_type( 'my_type' => __PACKAGE__ );
=cut
-BEGIN {
- %CLASS_FOR = (
- plan => 'TAP::Parser::Result::Plan',
- pragma => 'TAP::Parser::Result::Pragma',
- test => 'TAP::Parser::Result::Test',
- comment => 'TAP::Parser::Result::Comment',
- bailout => 'TAP::Parser::Result::Bailout',
- version => 'TAP::Parser::Result::Version',
- unknown => 'TAP::Parser::Result::Unknown',
- yaml => 'TAP::Parser::Result::YAML',
- );
-}
+our %CLASS_FOR = (
+ plan => 'TAP::Parser::Result::Plan',
+ pragma => 'TAP::Parser::Result::Pragma',
+ test => 'TAP::Parser::Result::Test',
+ comment => 'TAP::Parser::Result::Comment',
+ bailout => 'TAP::Parser::Result::Bailout',
+ version => 'TAP::Parser::Result::Version',
+ unknown => 'TAP::Parser::Result::Unknown',
+ yaml => 'TAP::Parser::Result::YAML',
+);
sub class_for {
my ( $class, $type ) = @_;
package MyResultFactory;
use strict;
- use vars '@ISA';
use MyResult;
- use TAP::Parser::ResultFactory;
- @ISA = qw( TAP::Parser::ResultFactory );
+ use parent 'TAP::Parser::ResultFactory';
# force all results to be 'MyResult'
sub class_for {
package TAP::Parser::Scheduler;
use strict;
-use vars qw($VERSION);
+use warnings;
+
use Carp;
use TAP::Parser::Scheduler::Job;
use TAP::Parser::Scheduler::Spinner;
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Scheduler::Job;
use strict;
-use vars qw($VERSION);
+use warnings;
use Carp;
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Scheduler::Spinner;
use strict;
-use vars qw($VERSION);
+use warnings;
use Carp;
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::Source;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
use File::Basename qw( fileparse );
+use parent 'TAP::Object';
use constant BLK_SIZE => 512;
-@ISA = qw(TAP::Object);
-
=head1 NAME
TAP::Parser::Source - a TAP source & meta data about it
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::SourceHandler;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
use TAP::Parser::Iterator ();
-
-@ISA = qw(TAP::Object);
+use parent 'TAP::Object';
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
# must be sub-classed for use
package MySourceHandler;
- use base qw( TAP::Parser::SourceHandler );
+ use parent 'TAP::Parser::SourceHandler';
sub can_handle { return $confidence_level }
sub make_iterator { return $iterator }
Start by familiarizing yourself with L<TAP::Parser::Source> and
L<TAP::Parser::IteratorFactory>. L<TAP::Parser::SourceHandler::RawTAP> is
-the easiest sub-class to use an an example.
+the easiest sub-class to use as an example.
It's important to point out that if you want your subclass to be automatically
used by L<TAP::Parser> you'll have to and make sure it gets loaded somehow.
package MySourceHandler;
use strict;
- use vars '@ISA'; # compat with older perls
use MySourceHandler; # see TAP::Parser::SourceHandler
use TAP::Parser::IteratorFactory;
- @ISA = qw( TAP::Parser::SourceHandler );
+ use parent 'TAP::Parser::SourceHandler';
TAP::Parser::IteratorFactory->register_handler( __PACKAGE__ );
package TAP::Parser::SourceHandler::Executable;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::SourceHandler ();
use TAP::Parser::IteratorFactory ();
use TAP::Parser::Iterator::Process ();
-@ISA = qw(TAP::Parser::SourceHandler);
+use parent 'TAP::Parser::SourceHandler';
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package MyRubySourceHandler;
use strict;
- use vars '@ISA';
use Carp qw( croak );
use TAP::Parser::SourceHandler::Executable;
- @ISA = qw( TAP::Parser::SourceHandler::Executable );
+ use parent 'TAP::Parser::SourceHandler::Executable';
# expect $handler->(['mytest.rb', 'cmdline', 'args']);
sub make_iterator {
package TAP::Parser::SourceHandler::File;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::SourceHandler ();
use TAP::Parser::IteratorFactory ();
use TAP::Parser::Iterator::Stream ();
-@ISA = qw(TAP::Parser::SourceHandler);
+use parent 'TAP::Parser::SourceHandler';
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::SourceHandler::Handle;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::SourceHandler ();
use TAP::Parser::IteratorFactory ();
use TAP::Parser::Iterator::Stream ();
-@ISA = qw(TAP::Parser::SourceHandler);
+use parent 'TAP::Parser::SourceHandler';
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
package TAP::Parser::SourceHandler::Perl;
use strict;
+use warnings;
use Config;
-use vars qw($VERSION @ISA);
use constant IS_WIN32 => ( $^O =~ /^(MS)?Win32$/ );
use constant IS_VMS => ( $^O eq 'VMS' );
-use TAP::Parser::SourceHandler::Executable ();
use TAP::Parser::IteratorFactory ();
use TAP::Parser::Iterator::Process ();
-use TAP::Parser::Utils qw( split_shell );
+use Text::ParseWords qw(shellwords);
-@ISA = 'TAP::Parser::SourceHandler::Executable';
+use parent 'TAP::Parser::SourceHandler::Executable';
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
# PERL5LIB as -I switches and place PERL5OPT on the command line
# in order that it be seen.
if ( $class->_has_taint_switch($switches) ) {
- my @perl5lib = split /$Config{path_sep}/, $ENV{PERL5LIB};
+ my @perl5lib = defined $ENV{PERL5LIB} ? split /$Config{path_sep}/, $ENV{PERL5LIB} : ();
return (
$libs,
[ @{$switches},
$class->_libs2switches([@$libs, @perl5lib]),
- split_shell( $ENV{PERL5OPT} )
+ defined $ENV{PERL5OPT} ? shellwords( $ENV{PERL5OPT} ) : ()
],
);
}
package MyPerlSourceHandler;
use strict;
- use vars '@ISA';
use TAP::Parser::SourceHandler::Perl;
- @ISA = qw( TAP::Parser::SourceHandler::Perl );
+ use parent 'TAP::Parser::SourceHandler::Perl';
# use the version of perl from the shebang line in the test file
sub get_perl {
package TAP::Parser::SourceHandler::RawTAP;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Parser::SourceHandler ();
use TAP::Parser::IteratorFactory ();
use TAP::Parser::Iterator::Array ();
-@ISA = qw(TAP::Parser::SourceHandler);
+use parent 'TAP::Parser::SourceHandler';
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
=head1 SYNOPSIS
+++ /dev/null
-package TAP::Parser::Utils;
-
-use strict;
-use Exporter;
-use vars qw($VERSION @ISA @EXPORT_OK);
-
-@ISA = qw( Exporter );
-@EXPORT_OK = qw( split_shell );
-
-=head1 NAME
-
-TAP::Parser::Utils - Internal TAP::Parser utilities
-
-=head1 VERSION
-
-Version 3.28
-
-=cut
-
-$VERSION = '3.28';
-
-=head1 SYNOPSIS
-
- use TAP::Parser::Utils qw( split_shell )
- my @switches = split_shell( $arg );
-
-=head1 DESCRIPTION
-
-B<FOR INTERNAL USE ONLY!>
-
-=head2 INTERFACE
-
-=head3 C<split_shell>
-
-Shell style argument parsing. Handles backslash escaping, single and
-double quoted strings but not shell substitutions.
-
-Pass one or more strings containing shell escaped arguments. The return
-value is an array of arguments parsed from the input strings according
-to (approximate) shell parsing rules. It's legal to pass C<undef> in
-which case an empty array will be returned. That makes it possible to
-
- my @args = split_shell( $ENV{SOME_ENV_VAR} );
-
-without worrying about whether the environment variable exists.
-
-This is used to split HARNESS_PERL_ARGS into individual switches.
-
-=cut
-
-sub split_shell {
- my @parts = ();
-
- for my $switch ( grep defined && length, @_ ) {
- push @parts, $1 while $switch =~ /
- (
- (?: [^\\"'\s]+
- | \\.
- | " (?: \\. | [^"] )* "
- | ' (?: \\. | [^'] )* '
- )+
- ) /xg;
- }
-
- for (@parts) {
- s/ \\(.) | ['"] /defined $1 ? $1 : ''/exg;
- }
-
- return @parts;
-}
-
-1;
package TAP::Parser::YAMLish::Reader;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
+use parent 'TAP::Object';
-@ISA = 'TAP::Object';
-$VERSION = '3.28';
+our $VERSION = '3.29';
# TODO:
# Handle blessed object syntax
=head1 VERSION
-Version 3.28
+Version 3.29
=head1 SYNOPSIS
package TAP::Parser::YAMLish::Writer;
use strict;
-use vars qw($VERSION @ISA);
+use warnings;
-use TAP::Object ();
+use parent 'TAP::Object';
-@ISA = 'TAP::Object';
-$VERSION = '3.28';
+our $VERSION = '3.29';
my $ESCAPE_CHAR = qr{ [ \x00-\x1f \" ] }x;
my $ESCAPE_KEY = qr{ (?: ^\W ) | $ESCAPE_CHAR }x;
=head1 VERSION
-Version 3.28
+Version 3.29
=head1 SYNOPSIS
package Test::Harness;
-require 5.00405;
+use 5.006;
use strict;
+use warnings;
use constant IS_WIN32 => ( $^O =~ /^(MS)?Win32$/ );
use constant IS_VMS => ( $^O eq 'VMS' );
use TAP::Parser::Source ();
use TAP::Parser::SourceHandler::Perl ();
-use TAP::Parser::Utils qw( split_shell );
+use Text::ParseWords qw(shellwords);
use Config;
-use Exporter;
-
-# TODO: Emulate at least some of these
-use vars qw(
- $VERSION
- @ISA @EXPORT @EXPORT_OK
- $Verbose $Switches $Debug
- $verbose $switches $debug
- $Columns
- $Color
- $Directives
- $Timer
- $Strap
- $HarnessSubclass
- $has_time_hires
- $IgnoreExit
-);
+use parent 'Exporter';
# $ML $Last_ML_Print
BEGIN {
eval q{use Time::HiRes 'time'};
- $has_time_hires = !$@;
+ our $has_time_hires = !$@;
}
=head1 NAME
=head1 VERSION
-Version 3.28
+Version 3.29
=cut
-$VERSION = '3.28';
+our $VERSION = '3.29';
# Backwards compatibility for exportable variable names.
*verbose = *Verbose;
delete $ENV{HARNESS_VERSION};
}
-@ISA = ('Exporter');
-@EXPORT = qw(&runtests);
-@EXPORT_OK = qw(&execute_tests $verbose $switches);
+our @EXPORT = qw(&runtests);
+our @EXPORT_OK = qw(&execute_tests $verbose $switches);
-$Verbose = $ENV{HARNESS_VERBOSE} || 0;
-$Debug = $ENV{HARNESS_DEBUG} || 0;
-$Switches = '-w';
-$Columns = $ENV{HARNESS_COLUMNS} || $ENV{COLUMNS} || 80;
+our $Verbose = $ENV{HARNESS_VERBOSE} || 0;
+our $Debug = $ENV{HARNESS_DEBUG} || 0;
+our $Switches = '-w';
+our $Columns = $ENV{HARNESS_COLUMNS} || $ENV{COLUMNS} || 80;
$Columns--; # Some shells have trouble with a full line of text.
-$Timer = $ENV{HARNESS_TIMER} || 0;
-$Color = $ENV{HARNESS_COLOR} || 0;
-$IgnoreExit = $ENV{HARNESS_IGNORE_EXIT} || 0;
+our $Timer = $ENV{HARNESS_TIMER} || 0;
+our $Color = $ENV{HARNESS_COLOR} || 0;
+our $IgnoreExit = $ENV{HARNESS_IGNORE_EXIT} || 0;
=head1 SYNOPSIS
my $sub_args = shift || {};
my ( @lib, @switches );
- my @opt = split_shell( $Switches, $ENV{HARNESS_PERL_SWITCHES} );
+ my @opt = map { shellwords($_) } grep { defined } $Switches, $ENV{HARNESS_PERL_SWITCHES};
while ( my $opt = shift @opt ) {
if ( $opt =~ /^ -I (.*) $ /x ) {
push @lib, length($1) ? $1 : shift @opt;
my $args = {
timer => $Timer,
- directives => $Directives,
+ directives => our $Directives,
lib => \@lib,
switches => \@switches,
color => $Color,
Specifies a TAP::Harness subclass to be used in place of TAP::Harness.
+=item C<HARNESS_SUMMARY_COLOR_SUCCESS>
+
+Determines the L<Term::ANSIColor> for the summary in case it is successful.
+This color defaults to C<'green'>.
+
+=item C<HARNESS_SUMMARY_COLOR_FAIL>
+
+Determines the L<Term::ANSIColor> for the failure in case it is successful.
+This color defaults to C<'red'>.
+
=back
=head1 Taint Mode
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 81;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 33;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 38;
package CallbackOK;
use TAP::Base;
-use vars qw(@ISA);
-@ISA = 'TAP::Base';
+use parent 'TAP::Base';
sub _initialize {
my $self = shift;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 10;
# Test that env vars are honoured.
use strict;
+use warnings;
use lib 't/lib';
use Test::More (
#!/usr/bin/perl -w
use strict;
+use warnings;
use Test::More tests => 12;
use Test::Harness;
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 5;
# process.
use strict;
+use warnings;
use lib 't/lib';
use Config;
}
use strict;
+use warnings;
use Test::More tests => 1;
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 1;
# Test that HARNESS_SUBCLASS env var is honoured.
use strict;
+use warnings;
use lib 't/lib';
use Test::More (
#!/usr/bin/perl -w
use strict;
+use warnings;
use Test::More (
$^O eq 'VMS'
? ( skip_all => 'VMS' )
}
use strict;
+use warnings;
# use lib 't/lib';
#!/usr/bin/perl -Tw
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 2;
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
use TAP::Formatter::Console;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 23;
}
use strict;
+use warnings;
use Test::More;
{
my @output;
- local $^W;
+ no warnings 'redefine';
require TAP::Formatter::Base;
local *TAP::Formatter::Base::_output = sub {
my $self = shift;
#!/usr/bin/perl -w
use strict;
+use warnings;
use Test::More;
#!/usr/bin/perl -w
use strict;
+use warnings;
BEGIN {
unshift @INC, 't/lib';
#!perl
use strict;
+use warnings;
use File::Spec;
BEGIN {
}
use strict;
+use warnings;
use TAP::Harness;
use Test::More tests => 13;
}
use strict;
+use warnings;
use Test::More;
use IO::c55Capture;
use TAP::Harness;
+# This is done to prevent the colors environment variables from
+# interfering.
+local %ENV = %ENV;
+delete $ENV{HARNESS_SUMMARY_COLOR_FAIL};
+delete $ENV{HARNESS_SUMMARY_COLOR_SUCCESS};
+
my $HARNESS = 'TAP::Harness';
my $source_tests = 't/source_tests';
{
my @output;
- local $^W;
+ no warnings 'redefine';
local *TAP::Formatter::Base::_output = sub {
my $self = shift;
push @output => grep { $_ ne '' }
}
use strict;
+use warnings;
use Test::More tests => 42;
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 76;
my $teardown = sub { $did_teardown++ };
package NoForkProcess;
-use vars qw( @ISA );
-@ISA = qw( TAP::Parser::Iterator::Process );
+use parent qw( TAP::Parser::Iterator::Process );
sub _use_open3 {return}
package App::Prove::Plugin::Dummy;
use strict;
+use warnings;
sub import {
main::test_log_import(@_);
package App::Prove::Plugin::Dummy2;
use strict;
+use warnings;
sub import {
main::test_log_import(@_);
package EmptyParser;
use strict;
-use vars qw(@ISA);
+use warnings;
-use TAP::Parser ();
-
-@ISA = qw(TAP::Parser);
+use parent qw(TAP::Parser);
sub _initialize {
shift->_set_defaults;
package MyCustom;
use strict;
+use warnings;
sub custom {
my $self = shift;
package MyFileSourceHandler;
use strict;
-use vars qw( @ISA $LAST_OBJ $CAN_HANDLE $MAKE_ITER $LAST_SOURCE );
+use warnings;
+our ($LAST_OBJ, $CAN_HANDLE, $MAKE_ITER, $LAST_SOURCE);
-use MyCustom;
use TAP::Parser::IteratorFactory;
-use TAP::Parser::SourceHandler::File;
-@ISA = qw( TAP::Parser::SourceHandler::File MyCustom );
+use parent qw( TAP::Parser::SourceHandler::File MyCustom );
$LAST_OBJ = undef;
$CAN_HANDLE = undef;
$MAKE_ITER = undef;
package MyGrammar;
use strict;
-use vars '@ISA';
+use warnings;
-use MyCustom;
-use TAP::Parser::Grammar;
-
-@ISA = qw( TAP::Parser::Grammar MyCustom );
+use parent qw( TAP::Parser::Grammar MyCustom );
sub _initialize {
my $self = shift;
package MyIterator;
use strict;
-use vars '@ISA';
+use warnings;
-use MyCustom;
-use TAP::Parser::Iterator;
-
-@ISA = qw( TAP::Parser::Iterator MyCustom );
+use parent qw( TAP::Parser::Iterator MyCustom );
sub _initialize {
my $self = shift;
package MyPerlSourceHandler;
use strict;
-use vars '@ISA';
+use warnings;
-use MyCustom;
use TAP::Parser::IteratorFactory;
-use TAP::Parser::SourceHandler::Perl;
-@ISA = qw( TAP::Parser::SourceHandler::Perl MyCustom );
+use parent qw( TAP::Parser::SourceHandler::Perl MyCustom );
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
package MyResult;
use strict;
-use vars '@ISA';
+use warnings;
-use MyCustom;
-use TAP::Parser::Result;
-
-@ISA = qw( TAP::Parser::Result MyCustom );
+use parent qw( TAP::Parser::Result MyCustom );
sub _initialize {
my $self = shift;
package MyResultFactory;
use strict;
-use vars '@ISA';
+use warnings;
-use MyCustom;
use MyResult;
-use TAP::Parser::ResultFactory;
-@ISA = qw( TAP::Parser::ResultFactory MyCustom );
+use parent qw( TAP::Parser::ResultFactory MyCustom );
sub make_result {
my $class = shift;
package MySourceHandler;
use strict;
-use vars '@ISA';
+use warnings;
-use MyCustom;
use MyIterator;
use TAP::Parser::SourceHandler;
use TAP::Parser::IteratorFactory;
-#@ISA = qw( TAP::Parser::SourceHandler MyCustom );
-@ISA = qw( MyCustom );
+#use parent qw( TAP::Parser::SourceHandler MyCustom );
+use parent qw( MyCustom );
TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
package TAP::Harness::TestSubclass;
use strict;
+use warnings;
use base 'TAP::Harness';
sub aggregate_tests {
package TAP::Parser::SubclassTest;
use strict;
-use vars qw(@ISA);
+use warnings;
-use TAP::Parser;
-
-use MyCustom;
use MySourceHandler;
use MyPerlSourceHandler;
use MyGrammar;
use MyResultFactory;
-@ISA = qw( TAP::Parser MyCustom );
+use parent qw( TAP::Parser MyCustom );
sub _default_source_class {'MySourceHandler'} # deprecated
sub _default_perl_source_class {'MyPerlSourceHandler'} # deprecated
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More qw( no_plan );
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 5;
}
use strict;
+use warnings;
use NoFork;
require('t/multiplexer.t');
}
use strict;
+use warnings;
use Config;
use Test::More (
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 7;
{
package TAP::TestObj;
- use vars qw(@ISA);
- @ISA = qw(TAP::Object);
+ use parent qw(TAP::Object);
sub _initialize {
my $self = shift;
#!/usr/bin/perl -w
use strict;
+use warnings;
BEGIN {
use lib 't/lib';
package TAP::Parser::Iterator::Dies;
use strict;
- use vars qw(@ISA);
- @ISA = qw(TAP::Parser::Iterator);
+ use parent qw(TAP::Parser::Iterator);
sub next_raw {
die 'this is the dying iterator';
# coverage testing of TAP::Parser::_next_state
package TAP::Parser::WithBrokenState;
- use vars qw(@ISA);
- @ISA = qw( TAP::Parser );
+ use parent qw( TAP::Parser );
sub _make_state_table {
return { INIT => { plan => { goto => 'FOO' } } };
# coverage testing of TAP::Parser::_iter
package TAP::Parser::WithBrokenIter;
- use vars qw(@ISA);
- @ISA = qw( TAP::Parser );
+ use parent qw( TAP::Parser );
sub _iter {return}
}
use strict;
-use vars qw(%INIT %CUSTOM);
+use warnings;
+our (%INIT, %CUSTOM);
use Test::More tests => 5;
use File::Spec::Functions qw( catfile updir );
}
use strict;
-use vars qw(%INIT %CUSTOM);
+use warnings;
+our (%INIT, %CUSTOM);
use Test::More tests => 14;
use File::Spec::Functions qw( catfile updir );
# process.
use strict;
+use warnings;
use lib 't/lib';
use Config;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 14;
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
my $hires;
}
use strict;
+use warnings;
use Test::More;
use File::Spec;
use App::Prove;
use Getopt::Long;
-use TAP::Parser::Utils qw( split_shell );
+use Text::ParseWords qw(shellwords);
package FakeProve;
-use vars qw( @ISA );
-@ISA = qw( App::Prove );
+use parent qw( App::Prove );
sub new {
my $class = shift;
# adapt our expectations if HARNESS_PERL_SWITCHES is set
push @{ $runlog->[0][1]{switches} },
- split_shell( $ENV{HARNESS_PERL_SWITCHES} )
+ shellwords( $ENV{HARNESS_PERL_SWITCHES} )
if $ENV{HARNESS_PERL_SWITCHES};
unless (
#!perl
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 2;
use App::Prove;
}
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 1;
use File::Spec;
}
use strict;
+use warnings;
use Test::More;
use File::Spec;
use App::Prove;
-use TAP::Parser::Utils qw( split_shell );
+use Text::ParseWords qw(shellwords);
my @SCHEDULE;
command => [
'PERL',
$ENV{HARNESS_PERL_SWITCHES}
- ? split_shell( $ENV{HARNESS_PERL_SWITCHES} )
+ ? shellwords( $ENV{HARNESS_PERL_SWITCHES} )
: (),
$_->{file},
],
# Waaaaay too much boilerplate
package FakeProve;
-use vars qw( @ISA );
-@ISA = qw( App::Prove );
+use parent qw( App::Prove );
sub new {
my $class = shift;
# Patch TAP::Parser::Iterator::Process
my @call_log = ();
- local $^W; # no warnings
+ no warnings qw(redefine once);
my $orig_new = TAP::Parser::Iterator::Process->can('new');
- # Avoid "used only once" warning
- *TAP::Parser::Iterator::Process::new
- = *TAP::Parser::Iterator::Process::new = sub {
+ *TAP::Parser::Iterator::Process::new = sub {
push @call_log, [ 'new', @_ ];
# And then new turns round and tramples on our args...
}
use strict;
+use warnings;
use Test::More tests => 1;
use IO::c55Capture; # for util
}
use strict;
+use warnings;
use Test::More 'no_plan';
);
my %HANDLER_FOR = (
- NOT_ZERO, sub { local $^W; 0 != shift },
- TRUE, sub { local $^W; !!shift },
- FALSE, sub { local $^W; !shift },
+ NOT_ZERO, sub { no warnings; 0 != shift },
+ TRUE, sub { no warnings; !!shift },
+ FALSE, sub { no warnings; !shift },
);
my $can_open3 = ( $Config{d_fork} || $IsWin32 ) ? 1 : 0;
for my $hide_fork ( 0 .. $can_open3 ) {
if ($hide_fork) {
no strict 'refs';
- local $^W = 0;
+ no warnings 'redefine';
*{'TAP::Parser::Iterator::Process::_use_open3'} = sub {return};
}
"... and $method should return a reasonable value ($test)";
}
elsif ( !ref $answer ) {
- local $^W; # uninit warnings
+ no warnings 'uninitialized';
$answer = _vmsify_answer( $method, $answer );
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 227;
package MyResult;
use strict;
- use vars qw($VERSION @ISA);
- @ISA = 'TAP::Parser::Result';
+ use warnings;
+ our $VERSION;
+ use parent 'TAP::Parser::Result';
TAP::Parser::ResultFactory->register_type( 'my_type' => __PACKAGE__ );
}
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
}
use strict;
+use warnings;
use Test::More tests => 45;
use File::Spec;
}
use strict;
+use warnings;
use Test::More tests => 79;
# nearly everything
use strict;
+use warnings;
use Test::More;
my $useOrigOpen;
}
use strict;
+use warnings;
use Test::More;
use App::Prove::State;
use App::Prove::State::Result;
}
use strict;
+use warnings;
use Test::More tests => 25;
use App::Prove::State;
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 49;
# Test that environment options are propagated to tainted tests
use strict;
+use warnings;
use Test::More ( $^O eq 'VMS' ? ( skip_all => 'VMS' ) : ( tests => 2 ) );
use Config;
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
package Test::Prove;
-use vars qw(@ISA);
-@ISA = 'App::Prove';
+use parent 'App::Prove';
sub _runtests {
my $self = shift;
#!/usr/bin/perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
use TAP::Parser;
+++ /dev/null
-#!/usr/bin/perl -w
-
-use strict;
-use lib 't/lib';
-
-use TAP::Parser::Utils qw( split_shell );
-use Test::More;
-
-my @schedule = (
- { name => 'Bare words',
- in => 'bare words are here',
- out => [ 'bare', 'words', 'are', 'here' ],
- },
- { name => 'Single quotes',
- in => "'bare' 'words' 'are' 'here'",
- out => [ 'bare', 'words', 'are', 'here' ],
- },
- { name => 'Double quotes',
- in => '"bare" "words" "are" "here"',
- out => [ 'bare', 'words', 'are', 'here' ],
- },
- { name => 'Escapes',
- in => '\ "ba\"re" \'wo\\\'rds\' \\\\"are" "here"',
- out => [ ' ', 'ba"re', "wo'rds", '\\are', 'here' ],
- },
- { name => 'Flag',
- in => '-e "system(shift)"',
- out => [ '-e', 'system(shift)' ],
- },
- { name => 'Nada',
- in => undef,
- out => [],
- },
- { name => 'Nada II',
- in => '',
- out => [],
- },
- { name => 'Zero',
- in => 0,
- out => ['0'],
- },
- { name => 'Empty',
- in => '""',
- out => [''],
- },
- { name => 'Empty II',
- in => "''",
- out => [''],
- },
-);
-
-plan tests => 1 * @schedule;
-
-for my $test (@schedule) {
- my $name = $test->{name};
- my @got = split_shell( $test->{in} );
- unless ( is_deeply \@got, $test->{out}, "$name: parse OK" ) {
- use Data::Dumper;
- diag( Dumper( { want => $test->{out}, got => \@got } ) );
- }
-}
#!/usr/bin/perl -wT
use strict;
+use warnings;
use lib 't/lib';
use Test::More tests => 9;
#!/usr/bin/perl
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
#!perl -w
use strict;
+use warnings;
use lib 't/lib';
use Test::More;
Numerous updates and bug fixes are incorporated. See the F<Changes> file in
the CPAN distribution for full details.
+=item *
+
+L<Test::Harness> has been upgraded from version 3.28 to 3.29.
+
+All modules now use C<our> rather than C<use vars>, have C<use warnings>
+enabled and C<use parent> instead of @ISA.
+
=back
=head2 Removed Modules and Pragmata