Change 33966 by [EMAIL PROTECTED] on 2008/05/31 14:44:46

        Integrate:
        [ 33281]
        Upgrade to Test-Harness-3.09

Affected files ...

... //depot/maint-5.10/perl/MANIFEST#34 integrate
... //depot/maint-5.10/perl/lib/App/Prove.pm#5 integrate
... //depot/maint-5.10/perl/lib/App/Prove/State.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Base.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Formatter/Color.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Formatter/Console.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Formatter/Console/ParallelSession.pm#5 
integrate
... //depot/maint-5.10/perl/lib/TAP/Formatter/Console/Session.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Harness.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Aggregator.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Grammar.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Iterator.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Iterator/Array.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Iterator/Process.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Iterator/Stream.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Multiplexer.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/Bailout.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/Comment.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/Plan.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/Test.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/Unknown.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/Version.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Result/YAML.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Source.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Source/Perl.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/Utils.pm#1 branch
... //depot/maint-5.10/perl/lib/TAP/Parser/YAMLish/Reader.pm#5 integrate
... //depot/maint-5.10/perl/lib/TAP/Parser/YAMLish/Writer.pm#5 integrate
... //depot/maint-5.10/perl/lib/Test/Harness.pm#6 integrate
... //depot/maint-5.10/perl/lib/Test/Harness/bin/prove#5 integrate
... //depot/maint-5.10/perl/lib/Test/Harness/t/000-load.t#3 integrate
... //depot/maint-5.10/perl/lib/Test/Harness/t/compat/env.t#2 integrate
... //depot/maint-5.10/perl/lib/Test/Harness/t/utils.t#1 branch

Differences ...

==== //depot/maint-5.10/perl/MANIFEST#34 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#33~33961~     2008-05-31 07:30:09.000000000 -0700
+++ perl/MANIFEST       2008-05-31 07:44:46.000000000 -0700
@@ -2648,6 +2648,7 @@
 lib/TAP/Parser/Result/YAML.pm          A parser for Test Anything Protocol
 lib/TAP/Parser/Source.pm               A parser for Test Anything Protocol
 lib/TAP/Parser/Source/Perl.pm          A parser for Test Anything Protocol
+lib/TAP/Parser/Utils.pm                        A parser for Test Anything 
Protocol
 lib/TAP/Parser/YAMLish/Reader.pm       A parser for Test Anything Protocol
 lib/TAP/Parser/YAMLish/Writer.pm       A parser for Test Anything Protocol
 lib/Term/ANSIColor/ChangeLog   Term::ANSIColor
@@ -2709,6 +2710,7 @@
 lib/Test/Harness/t/taint.t             Test::Harness test
 lib/Test/Harness/t/testargs.t          Test::Harness test
 lib/Test/Harness/t/unicode.t           Test::Harness test
+lib/Test/Harness/t/utils.t             Test::Harness test
 lib/Test/Harness/t/yamlish-output.t    Test::Harness test
 lib/Test/Harness/t/yamlish-writer.t    Test::Harness test
 lib/Test/Harness/t/yamlish.t           Test::Harness test

==== //depot/maint-5.10/perl/lib/App/Prove.pm#5 (text) ====
Index: perl/lib/App/Prove.pm
--- perl/lib/App/Prove.pm#4~33965~      2008-05-31 07:41:55.000000000 -0700
+++ perl/lib/App/Prove.pm       2008-05-31 07:44:46.000000000 -0700
@@ -2,6 +2,7 @@
 
 use strict;
 use TAP::Harness;
+use TAP::Parser::Utils qw( split_shell );
 use File::Spec;
 use Getopt::Long;
 use App::Prove::State;
@@ -15,11 +16,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 
@@ -462,9 +463,7 @@
         push @switches, '-w';
     }
 
-    if ( defined( my $hps = $ENV{HARNESS_PERL_SWITCHES} ) ) {
-        push @switches, $hps;
-    }
+    push @switches, split_shell( $ENV{HARNESS_PERL_SWITCHES} );
 
     return @switches ? [EMAIL PROTECTED] : ();
 }

==== //depot/maint-5.10/perl/lib/App/Prove/State.pm#5 (text) ====
Index: perl/lib/App/Prove/State.pm
--- perl/lib/App/Prove/State.pm#4~33965~        2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/App/Prove/State.pm 2008-05-31 07:44:46.000000000 -0700
@@ -20,11 +20,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Base.pm#5 (text) ====
Index: perl/lib/TAP/Base.pm
--- perl/lib/TAP/Base.pm#4~33965~       2008-05-31 07:41:55.000000000 -0700
+++ perl/lib/TAP/Base.pm        2008-05-31 07:44:46.000000000 -0700
@@ -9,11 +9,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 my $GOT_TIME_HIRES;
 

==== //depot/maint-5.10/perl/lib/TAP/Formatter/Color.pm#5 (text) ====
Index: perl/lib/TAP/Formatter/Color.pm
--- perl/lib/TAP/Formatter/Color.pm#4~33965~    2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Formatter/Color.pm     2008-05-31 07:44:46.000000000 -0700
@@ -70,11 +70,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Formatter/Console.pm#5 (text) ====
Index: perl/lib/TAP/Formatter/Console.pm
--- perl/lib/TAP/Formatter/Console.pm#4~33965~  2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Formatter/Console.pm   2008-05-31 07:44:46.000000000 -0700
@@ -52,11 +52,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Formatter/Console/ParallelSession.pm#5 
(text) ====
Index: perl/lib/TAP/Formatter/Console/ParallelSession.pm
--- perl/lib/TAP/Formatter/Console/ParallelSession.pm#4~33965~  2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Formatter/Console/ParallelSession.pm   2008-05-31 
07:44:46.000000000 -0700
@@ -48,11 +48,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Formatter/Console/Session.pm#5 (text) ====
Index: perl/lib/TAP/Formatter/Console/Session.pm
--- perl/lib/TAP/Formatter/Console/Session.pm#4~33965~  2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Formatter/Console/Session.pm   2008-05-31 07:44:46.000000000 
-0700
@@ -36,11 +36,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Harness.pm#5 (text) ====
Index: perl/lib/TAP/Harness.pm
--- perl/lib/TAP/Harness.pm#4~33965~    2008-05-31 07:41:55.000000000 -0700
+++ perl/lib/TAP/Harness.pm     2008-05-31 07:44:46.000000000 -0700
@@ -22,11 +22,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 $ENV{HARNESS_ACTIVE}  = 1;
 $ENV{HARNESS_VERSION} = $VERSION;
@@ -484,7 +484,7 @@
 When you supply a separate display name it becomes possible to run a
 test more than once; the display name is effectively the alias by which
 the test is known inside the harness. The harness doesn't care if it
-runs the same script more than once along as each invocation uses a
+runs the same script more than once when each invocation uses a
 different name.
 
 =cut
@@ -496,6 +496,10 @@
 
     my @expanded = map { 'ARRAY' eq ref $_ ? $_ : [ $_, $_ ] } @tests;
 
+    # #12458
+    local $ENV{HARNESS_IS_VERBOSE} = 1
+      if $self->formatter->verbosity > 0;
+
     # Formatter gets only names
     $self->formatter->prepare( map { $_->[1] } @expanded );
 

==== //depot/maint-5.10/perl/lib/TAP/Parser.pm#5 (text) ====
Index: perl/lib/TAP/Parser.pm
--- perl/lib/TAP/Parser.pm#4~33965~     2008-05-31 07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser.pm      2008-05-31 07:44:46.000000000 -0700
@@ -19,11 +19,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 my $DEFAULT_TAP_VERSION = 12;
 my $MAX_TAP_VERSION     = 13;
@@ -506,13 +506,6 @@
 
 This is merely a synonym for C<as_string>.
 
-=head3 C<tests_planned>
-
-  my $planned = $result->tests_planned;
-
-Returns the number of tests planned.  For example, a plan of C<1..17> will
-cause this method to return '17'.
-
 =head3 C<directive>
 
  my $directive = $result->directive;

==== //depot/maint-5.10/perl/lib/TAP/Parser/Aggregator.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Aggregator.pm
--- perl/lib/TAP/Parser/Aggregator.pm#4~33965~  2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Aggregator.pm   2008-05-31 07:44:46.000000000 -0700
@@ -10,11 +10,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Grammar.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Grammar.pm
--- perl/lib/TAP/Parser/Grammar.pm#4~33965~     2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Grammar.pm      2008-05-31 07:44:46.000000000 -0700
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Iterator.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Iterator.pm
--- perl/lib/TAP/Parser/Iterator.pm#4~33965~    2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Iterator.pm     2008-05-31 07:44:46.000000000 -0700
@@ -13,11 +13,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Iterator/Array.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Iterator/Array.pm
--- perl/lib/TAP/Parser/Iterator/Array.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Iterator/Array.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Iterator/Process.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Iterator/Process.pm
--- perl/lib/TAP/Parser/Iterator/Process.pm#4~33965~    2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Iterator/Process.pm     2008-05-31 07:44:46.000000000 
-0700
@@ -19,11 +19,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Iterator/Stream.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Iterator/Stream.pm
--- perl/lib/TAP/Parser/Iterator/Stream.pm#4~33965~     2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Iterator/Stream.pm      2008-05-31 07:44:46.000000000 
-0700
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Multiplexer.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Multiplexer.pm
--- perl/lib/TAP/Parser/Multiplexer.pm#4~33965~ 2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Multiplexer.pm  2008-05-31 07:44:46.000000000 -0700
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result.pm
--- perl/lib/TAP/Parser/Result.pm#4~33965~      2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Result.pm       2008-05-31 07:44:46.000000000 -0700
@@ -27,11 +27,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head2 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/Bailout.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/Bailout.pm
--- perl/lib/TAP/Parser/Result/Bailout.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Result/Bailout.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/Comment.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/Comment.pm
--- perl/lib/TAP/Parser/Result/Comment.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Result/Comment.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/Plan.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/Plan.pm
--- perl/lib/TAP/Parser/Result/Plan.pm#4~33965~ 2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Result/Plan.pm  2008-05-31 07:44:46.000000000 -0700
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/Test.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/Test.pm
--- perl/lib/TAP/Parser/Result/Test.pm#4~33965~ 2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Result/Test.pm  2008-05-31 07:44:46.000000000 -0700
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/Unknown.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/Unknown.pm
--- perl/lib/TAP/Parser/Result/Unknown.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Result/Unknown.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/Version.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/Version.pm
--- perl/lib/TAP/Parser/Result/Version.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/Result/Version.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Result/YAML.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Result/YAML.pm
--- perl/lib/TAP/Parser/Result/YAML.pm#4~33965~ 2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Result/YAML.pm  2008-05-31 07:44:46.000000000 -0700
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Source.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Source.pm
--- perl/lib/TAP/Parser/Source.pm#4~33965~      2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Source.pm       2008-05-31 07:44:46.000000000 -0700
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Source/Perl.pm#5 (text) ====
Index: perl/lib/TAP/Parser/Source/Perl.pm
--- perl/lib/TAP/Parser/Source/Perl.pm#4~33965~ 2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/TAP/Parser/Source/Perl.pm  2008-05-31 07:44:46.000000000 -0700
@@ -16,11 +16,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 =head1 DESCRIPTION
 
@@ -262,11 +262,6 @@
         $_ = qq["$_"] if ( ( /\s/ || IS_VMS ) && !/^".*"$/ );
     }
 
-    my %found_switch = map { $_ => 0 } @switches;
-
-    # remove duplicate switches
-    @switches
-      = grep { defined $_ && $_ ne '' && !$found_switch{$_}++ } @switches;
     return @switches;
 }
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/Utils.pm#1 (text) ====
Index: perl/lib/TAP/Parser/Utils.pm
--- /dev/null   2008-05-07 15:08:24.549929899 -0700
+++ perl/lib/TAP/Parser/Utils.pm        2008-05-31 07:44:46.000000000 -0700
@@ -0,0 +1,72 @@
+package TAP::Parser::Utils;
+
+use strict;
+use Exporter;
+use vars qw($VERSION @ISA @EXPORT_OK);
+
[EMAIL PROTECTED]       = qw( Exporter );
[EMAIL PROTECTED] = qw( split_shell );
+
+=head1 NAME
+
+TAP::Parser::Utils - Internal TAP::Parser utilities
+
+=head1 VERSION
+
+Version 3.09
+
+=cut
+
+$VERSION = '3.09';
+
+=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;

==== //depot/maint-5.10/perl/lib/TAP/Parser/YAMLish/Reader.pm#5 (text) ====
Index: perl/lib/TAP/Parser/YAMLish/Reader.pm
--- perl/lib/TAP/Parser/YAMLish/Reader.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/YAMLish/Reader.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -4,7 +4,7 @@
 
 use vars qw{$VERSION};
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 # TODO:
 #   Handle blessed object syntax
@@ -277,7 +277,7 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/TAP/Parser/YAMLish/Writer.pm#5 (text) ====
Index: perl/lib/TAP/Parser/YAMLish/Writer.pm
--- perl/lib/TAP/Parser/YAMLish/Writer.pm#4~33965~      2008-05-31 
07:41:55.000000000 -0700
+++ perl/lib/TAP/Parser/YAMLish/Writer.pm       2008-05-31 07:44:46.000000000 
-0700
@@ -4,7 +4,7 @@
 
 use vars qw{$VERSION};
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 my $ESCAPE_CHAR = qr{ [ \x00-\x1f \" ] }x;
 my $ESCAPE_KEY  = qr{ (?: ^\W ) | $ESCAPE_CHAR }x;
@@ -149,7 +149,7 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =head1 SYNOPSIS
 

==== //depot/maint-5.10/perl/lib/Test/Harness.pm#6 (text) ====
Index: perl/lib/Test/Harness.pm
--- perl/lib/Test/Harness.pm#5~33965~   2008-05-31 07:41:55.000000000 -0700
+++ perl/lib/Test/Harness.pm    2008-05-31 07:44:46.000000000 -0700
@@ -11,6 +11,8 @@
 use TAP::Parser::Aggregator   ();
 use TAP::Parser::Source::Perl ();
 
+use TAP::Parser::Utils qw( split_shell );
+
 use Config;
 use Exporter;
 
@@ -41,11 +43,11 @@
 
 =head1 VERSION
 
-Version 3.08
+Version 3.09
 
 =cut
 
-$VERSION = '3.08';
+$VERSION = '3.09';
 
 # Backwards compatibility for exportable variable names.
 *verbose  = *Verbose;
@@ -93,7 +95,8 @@
 supported is not reproduced here. Straps is now available as a stand
 alone module: L<Test::Harness::Straps>.
 
-See L<TAP::Parser> for the main documentation for this distribution.
+See L<TAP::Parser>, L<TAP::Harness> for the main documentation for this
+distribution.
 
 =head1 FUNCTIONS
 
@@ -221,14 +224,10 @@
 sub _new_harness {
     my $sub_args = shift || {};
 
-    if ( defined( my $env_sw = $ENV{HARNESS_PERL_SWITCHES} ) ) {
-        $Switches .= ' ' . $env_sw if ( length($env_sw) );
-    }
-
-    # This is a bit crufty. The switches have all been joined into a
-    # single string so we have to try and recover them.
     my ( @lib, @switches );
-    for my $opt ( split( /\s+(?=-)/, $Switches ) ) {
+    for my $opt (
+        split_shell( $Switches, $ENV{HARNESS_PERL_SWITCHES} ) )
+    {
         if ( $opt =~ /^ -I (.*) $ /x ) {
             push @lib, $1;
         }
@@ -556,6 +555,17 @@
 
 =back
 
+=head1 Taint Mode
+
+Normally when a Perl program is run in taint mode the contents of the
+C<PERL5LIB> environment variable do not appear in C<@INC>.
+
+Because C<PERL5LIB> is often used during testing to add build
+directories to C<@INC> C<Test::Harness> (actually
+L<TAP::Parser::Source::Perl>) passes the names of any directories found
+in C<PERL5LIB> as -I switches. The net effect of this is that
+C<PERL5LIB> is honoured even in taint mode.
+
 =head1 SEE ALSO
 
 L<TAP::Harness>
@@ -572,7 +582,8 @@
 
 Andy Armstrong  C<< <[EMAIL PROTECTED]> >>
 
-L<Test::Harness> (on which this module is based) has this attribution:
+L<Test::Harness> 2.64 (maintained by Andy Lester and on which this
+module is based) has this attribution:
 
     Either Tim Bunce or Andreas Koenig, we don't know. What we know for
     sure is, that it was inspired by Larry Wall's F<TEST> script that came

==== //depot/maint-5.10/perl/lib/Test/Harness/bin/prove#5 (text) ====
Index: perl/lib/Test/Harness/bin/prove
--- perl/lib/Test/Harness/bin/prove#4~33965~    2008-05-31 07:41:55.000000000 
-0700
+++ perl/lib/Test/Harness/bin/prove     2008-05-31 07:44:46.000000000 -0700
@@ -240,6 +240,17 @@
 
     $ prove -b --state=hot --state=all,save
 
+=head2 Taint Mode
+
+Normally when a Perl program is run in taint mode the contents of the
+C<PERL5LIB> environment variable do not appear in C<@INC>.
+
+Because C<PERL5LIB> is often used during testing to add build directories
+to C<@INC> prove (actually L<TAP::Parser::Source::Perl>) passes the
+names of any directories found in C<PERL5LIB> as -I switches. The net
+effect of this is that C<PERL5LIB> is honoured even when prove is run in
+taint mode.
+
 =cut
 
 # vim:ts=4:sw=4:et:sta

==== //depot/maint-5.10/perl/lib/Test/Harness/t/000-load.t#3 (text) ====
Index: perl/lib/Test/Harness/t/000-load.t
--- perl/lib/Test/Harness/t/000-load.t#2~33962~ 2008-05-31 07:32:23.000000000 
-0700
+++ perl/lib/Test/Harness/t/000-load.t  2008-05-31 07:44:46.000000000 -0700
@@ -3,7 +3,7 @@
 use strict;
 use lib 't/lib';
 
-use Test::More tests => 58;
+use Test::More tests => 60;
 
 BEGIN {
 
@@ -37,6 +37,7 @@
       TAP::Parser::Source
       TAP::Parser::YAMLish::Reader
       TAP::Parser::YAMLish::Writer
+      TAP::Parser::Utils
       Test::Harness
     );
 

==== //depot/maint-5.10/perl/lib/Test/Harness/t/utils.t#1 (text) ====
Index: perl/lib/Test/Harness/t/utils.t
--- /dev/null   2008-05-07 15:08:24.549929899 -0700
+++ perl/lib/Test/Harness/t/utils.t     2008-05-31 07:44:46.000000000 -0700
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    chdir 't' and @INC = '../lib' if $ENV{PERL_CORE};
+}
+
+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 [EMAIL PROTECTED], $test->{out}, "$name: parse OK" ) {
+        use Data::Dumper;
+        diag( Dumper( { want => $test->{out}, got => [EMAIL PROTECTED] } ) );
+    }
+}
End of Patch.

Reply via email to