r9703 - in /branches/upstream/libtest-harness-perl/current: ./ inc/ lib/App/ lib/TAP/ lib/TAP/Formatter/ lib/TAP/Formatter/Console/ lib/TAP/Parser/ lib/TAP/Parser/Iterator/ lib/TAP/Parser/Result/ lib/TAP/Parser/Source/ lib/TAP/Parser/YAMLish/ lib/Test/ t/ t/sample-tests/

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Sat Nov 24 04:40:19 UTC 2007


Author: tincho-guest
Date: Sat Nov 24 04:40:18 2007
New Revision: 9703

URL: http://svn.debian.org/wsvn/?sc=1&rev=9703
Log:
[svn-upgrade] Integrating new upstream version, libtest-harness-perl (3.03)

Modified:
    branches/upstream/libtest-harness-perl/current/Changes
    branches/upstream/libtest-harness-perl/current/META.yml
    branches/upstream/libtest-harness-perl/current/inc/MyBuilder.pm
    branches/upstream/libtest-harness-perl/current/lib/App/Prove.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Base.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Color.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/ParallelSession.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/Session.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Harness.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Aggregator.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Grammar.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Array.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Process.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Stream.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Multiplexer.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Bailout.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Comment.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Plan.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Test.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Unknown.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Version.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/YAML.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source/Perl.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Reader.pm
    branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Writer.pm
    branches/upstream/libtest-harness-perl/current/lib/Test/Harness.pm
    branches/upstream/libtest-harness-perl/current/t/harness.t
    branches/upstream/libtest-harness-perl/current/t/parse.t
    branches/upstream/libtest-harness-perl/current/t/process.t
    branches/upstream/libtest-harness-perl/current/t/sample-tests/delayed

Modified: branches/upstream/libtest-harness-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/Changes?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/Changes (original)
+++ branches/upstream/libtest-harness-perl/current/Changes Sat Nov 24 04:40:18 2007
@@ -1,4 +1,11 @@
 Revision history for Test-Harness
+
+3.03    2007-11-17
+        - Fixed some little bugs-waiting-to-happen inside
+          TAP::Parser::Grammar.
+        - Added parser_args callback to TAP::Harness.
+        - Made @INC propagation even more compatible with 2.64 so that
+          parrot still works *and* #30796 is fixed.
 
 3.02    2007-11-15
         - Process I/O now unbuffered, uses sysread, plays better with

Modified: branches/upstream/libtest-harness-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/META.yml?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/META.yml (original)
+++ branches/upstream/libtest-harness-perl/current/META.yml Sat Nov 24 04:40:18 2007
@@ -1,6 +1,6 @@
 ---
 name: Test-Harness
-version: 3.02
+version: 3.03
 author:
   - 'Andy Armstrong  C<< <andy at hexten.net> >>'
 abstract: Run Perl standard test scripts with statistics
@@ -18,88 +18,88 @@
 provides:
   App::Prove:
     file: lib/App/Prove.pm
-    version: 3.02
+    version: 3.03
   TAP::Base:
     file: lib/TAP/Base.pm
-    version: 3.02
+    version: 3.03
   TAP::Formatter::Color:
     file: lib/TAP/Formatter/Color.pm
-    version: 3.02
+    version: 3.03
   TAP::Formatter::Console:
     file: lib/TAP/Formatter/Console.pm
-    version: 3.02
+    version: 3.03
   TAP::Formatter::Console::ParallelSession:
     file: lib/TAP/Formatter/Console/ParallelSession.pm
-    version: 3.02
+    version: 3.03
   TAP::Formatter::Console::Session:
     file: lib/TAP/Formatter/Console/Session.pm
-    version: 3.02
+    version: 3.03
   TAP::Harness:
     file: lib/TAP/Harness.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser:
     file: lib/TAP/Parser.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Aggregator:
     file: lib/TAP/Parser/Aggregator.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Grammar:
     file: lib/TAP/Parser/Grammar.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Iterator:
     file: lib/TAP/Parser/Iterator.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Iterator::Array:
     file: lib/TAP/Parser/Iterator/Array.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Iterator::Process:
     file: lib/TAP/Parser/Iterator/Process.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Iterator::Stream:
     file: lib/TAP/Parser/Iterator/Stream.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Multiplexer:
     file: lib/TAP/Parser/Multiplexer.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result:
     file: lib/TAP/Parser/Result.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::Bailout:
     file: lib/TAP/Parser/Result/Bailout.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::Comment:
     file: lib/TAP/Parser/Result/Comment.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::Plan:
     file: lib/TAP/Parser/Result/Plan.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::Test:
     file: lib/TAP/Parser/Result/Test.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::Unknown:
     file: lib/TAP/Parser/Result/Unknown.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::Version:
     file: lib/TAP/Parser/Result/Version.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Result::YAML:
     file: lib/TAP/Parser/Result/YAML.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Source:
     file: lib/TAP/Parser/Source.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::Source::Perl:
     file: lib/TAP/Parser/Source/Perl.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::YAMLish::Reader:
     file: lib/TAP/Parser/YAMLish/Reader.pm
-    version: 3.02
+    version: 3.03
   TAP::Parser::YAMLish::Writer:
     file: lib/TAP/Parser/YAMLish/Writer.pm
-    version: 3.02
+    version: 3.03
   Test::Harness:
     file: lib/Test/Harness.pm
-    version: 3.02
+    version: 3.03
 generated_by: Module::Build version 0.2808
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: branches/upstream/libtest-harness-perl/current/inc/MyBuilder.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/inc/MyBuilder.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/inc/MyBuilder.pm (original)
+++ branches/upstream/libtest-harness-perl/current/inc/MyBuilder.pm Sat Nov 24 04:40:18 2007
@@ -83,4 +83,22 @@
     }
 }
 
+my @profiling_target = qw( -Mblib bin/prove --timer t/regression.t );
+
+sub ACTION_dprof {
+    system( $^X, '-d:DProf', @profiling_target );
+    exec( qw( dprofpp -R ) );
+}
+
+sub ACTION_smallprof {
+    system( $^X, '-d:SmallProf', @profiling_target );
+    open( FH, 'smallprof.out' ) or die "Can't open smallprof.out: $!";
+    @rows = grep { /\d+:/ } <FH>;
+    close FH;
+
+    @rows = reverse sort { (split(/\s+/,$a))[2] <=> (split(/\s+/,$b))[2] } @rows;
+    @rows = @rows[0..30];
+    print join( '', @rows );
+}
+
 1;

Modified: branches/upstream/libtest-harness-perl/current/lib/App/Prove.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/App/Prove.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/App/Prove.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/App/Prove.pm Sat Nov 24 04:40:18 2007
@@ -15,11 +15,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Base.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Base.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Base.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Base.pm Sat Nov 24 04:40:18 2007
@@ -9,11 +9,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 my $GOT_TIME_HIRES;
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Color.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Color.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Color.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Color.pm Sat Nov 24 04:40:18 2007
@@ -70,11 +70,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console.pm Sat Nov 24 04:40:18 2007
@@ -52,11 +52,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/ParallelSession.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/ParallelSession.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/ParallelSession.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/ParallelSession.pm Sat Nov 24 04:40:18 2007
@@ -48,11 +48,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/Session.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/Session.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/Session.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Formatter/Console/Session.pm Sat Nov 24 04:40:18 2007
@@ -36,11 +36,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 
@@ -186,14 +186,16 @@
 
             return if $really_quiet;
 
-            my $planned = $parser->tests_planned;
             my $is_test = $result->is_test;
 
             # These are used in close_test - but only if $really_quiet
             # is false - so it's safe to only set them here unless that
             # relationship changes.
 
-            $plan = '/' . ( $planned || 0 ) . ' ' unless $plan;
+            if ( !$plan ) {
+                my $planned = $parser->tests_planned || '0';
+                $plan = "/$planned ";
+            }
             $output = $formatter->_get_output_method($parser);
 
             if ( $show_count and $is_test ) {

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Harness.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Harness.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Harness.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Harness.pm Sat Nov 24 04:40:18 2007
@@ -22,11 +22,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 $ENV{HARNESS_ACTIVE}  = 1;
 $ENV{HARNESS_VERSION} = $VERSION;
@@ -222,6 +222,7 @@
 
 {
     my @legal_callback = qw(
+      parser_args
       made_parser
       before_runtests
       after_runtests
@@ -535,7 +536,9 @@
 sub make_parser {
     my ( $self, $test ) = @_;
 
-    my $parser = TAP::Parser->new( $self->_get_parser_args($test) );
+    my $args = $self->_get_parser_args($test);
+    $self->_make_callback( 'parser_args', $test, $args );
+    my $parser = TAP::Parser->new($args);
 
     $self->_make_callback( 'made_parser', $parser );
     my $session = $self->formatter->open_test( $test, $parser );

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser.pm Sat Nov 24 04:40:18 2007
@@ -19,11 +19,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 my $DEFAULT_TAP_VERSION = 12;
 my $MAX_TAP_VERSION     = 13;
@@ -172,7 +172,7 @@
      bailout => \&bailout_callback,
      unknown => \&unknown_callback,
  );
- 
+
  my $aggregator = TAP::Parser::Aggregator->new;
  foreach my $file ( @test_files ) {
      my $parser = TAP::Parser->new(
@@ -351,7 +351,7 @@
         }
 
         unless ($stream) {
-            $self->_croak("PANIC:  could not determine stream");
+            $self->_croak( 'PANIC: could not determine stream' );
         }
 
         while ( my ( $k, $v ) = each %initialize ) {
@@ -483,7 +483,7 @@
 If the above evaluates as true, the following methods will be available on the
 C<$result> object.
 
-=head3 C<plan> 
+=head3 C<plan>
 
   if ( $result->is_plan ) {
      print $result->plan;
@@ -500,7 +500,7 @@
 
 =head3 C<directive>
 
- my $directive = $result->directive; 
+ my $directive = $result->directive;
 
 If a SKIP directive is included with the plan, this method will return it.
 
@@ -520,7 +520,7 @@
 If the above evaluates as true, the following methods will be available on the
 C<$result> object.
 
-=head3 C<comment> 
+=head3 C<comment>
 
   if ( $result->is_comment ) {
       my $comment = $result->comment;
@@ -645,7 +645,7 @@
 =head3 C<in_todo>
 
   if ( $parser->in_todo ) { ... }
-  
+
 True while the most recent result was a TODO. Becomes true before the
 TODO result is returned and stays true until just before the next non-
 TODO test is returned.
@@ -736,7 +736,7 @@
  # the test numbers which unexpectedly succeeded
  my @todo_passed = $parser->todo_passed;
 
- # the number of tests which unexpectedly succeeded 
+ # the number of tests which unexpectedly succeeded
  my $todo_passed = $parser->todo_passed;
 
 This method lets you know which (or how many) tests actually passed but were
@@ -859,7 +859,7 @@
 =head3 C<version>
 
   $parser->version;
-  
+
 Once the parser is done, this will return the version number for the
 parsed TAP. Version numbers were introduced with TAP version 13 so if no
 version number is found version 12 is assumed.
@@ -922,7 +922,7 @@
 Note that it's perfectly acceptable for some lines to have test numbers and
 others to not have them.  However, when a test number is found, it must be in
 sequence.  The following is also an error:
- 
+
  1..3
  ok 1 - input file opened
  not ok - first line of the input valid # todo some data
@@ -1079,7 +1079,7 @@
                 act => sub {
                     my ($version) = @_;
                     $self->_add_error(
-                        "More than one plan found in TAP output");
+                        'More than one plan found in TAP output');
                 },
             },
         },
@@ -1207,7 +1207,7 @@
 
             return $result;
         };
-    }
+    }    # _has_callbacks
     else {
         return sub {
             my $result = eval { $grammar->tokenize };
@@ -1227,7 +1227,7 @@
 
             return $result;
         };
-    }
+    }    # no callbacks
 }
 
 sub _finish {
@@ -1297,7 +1297,7 @@
      bailout => \&bailout_callback,
      unknown => \&unknown_callback,
  );
- 
+
  my $aggregator = TAP::Parser::Aggregator->new;
  foreach my $file ( @test_files ) {
      my $parser = TAP::Parser->new(
@@ -1372,7 +1372,7 @@
          }
          elsif ( $test->has_skip ) {
              print color 'white on_blue';
- 
+
          }
          elsif ( $test->has_todo ) {
              print color 'white';
@@ -1462,7 +1462,7 @@
 =item * GEOFFR
 
 =item * Shlomi Fish
-         
+
 =item * Torsten Schoenfeld
 
 =item * Jerry Gay
@@ -1516,7 +1516,7 @@
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2006 Curtis "Ovid" Poe, all rights reserved.
+Copyright 2006-2007 Curtis "Ovid" Poe, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Aggregator.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Aggregator.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Aggregator.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Aggregator.pm Sat Nov 24 04:40:18 2007
@@ -10,11 +10,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Grammar.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Grammar.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Grammar.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Grammar.pm Sat Nov 24 04:40:18 2007
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 
@@ -85,6 +85,7 @@
                 elsif ( 0 == $tests_planned ) {
                     $skip        = 'SKIP';
                     $explanation = $tail;
+
                     # Trim valid SKIP directive without being strict
                     # about its presence.
                     $explanation =~ s/^#\s*//;
@@ -257,8 +258,7 @@
 sub tokenize {
     my $self = shift;
 
-    my $stream = $self->{stream};
-    my $line   = $stream->next;
+    my $line = $self->{stream}->next;
     return unless defined $line;
 
     my $token;
@@ -393,7 +393,7 @@
     return {
         type    => 'comment',
         raw     => $line,
-        comment => _trim($1)
+        comment => _trim($comment)
     };
 }
 
@@ -440,7 +440,10 @@
 }
 
 sub _trim {
-    my $data = shift || '';
+    my $data = shift;
+
+    return '' unless defined $data;
+
     $data =~ s/^\s+//;
     $data =~ s/\s+$//;
     return $data;

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator.pm Sat Nov 24 04:40:18 2007
@@ -13,11 +13,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Array.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Array.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Array.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Array.pm Sat Nov 24 04:40:18 2007
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Process.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Process.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Process.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Process.pm Sat Nov 24 04:40:18 2007
@@ -19,11 +19,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 SYNOPSIS
 
@@ -259,7 +259,7 @@
                 }
 
                 # Return partial last line
-                if ($partial) {
+                if ( length $partial ) {
                     my $last = $partial;
                     $partial = '';
                     return $last;

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Stream.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Stream.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Stream.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Iterator/Stream.pm Sat Nov 24 04:40:18 2007
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Multiplexer.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Multiplexer.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Multiplexer.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Multiplexer.pm Sat Nov 24 04:40:18 2007
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result.pm Sat Nov 24 04:40:18 2007
@@ -27,11 +27,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head2 DESCRIPTION
 
@@ -206,7 +206,7 @@
 
 sub has_directive {
     my $self = shift;
-    return ( $self->has_todo || $self->has_skip ) || '';
+    return ( $self->has_todo || $self->has_skip );
 }
 
 ##############################################################################

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Bailout.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Bailout.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Bailout.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Bailout.pm Sat Nov 24 04:40:18 2007
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Comment.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Comment.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Comment.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Comment.pm Sat Nov 24 04:40:18 2007
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Plan.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Plan.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Plan.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Plan.pm Sat Nov 24 04:40:18 2007
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Test.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Test.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Test.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Test.pm Sat Nov 24 04:40:18 2007
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Unknown.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Unknown.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Unknown.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Unknown.pm Sat Nov 24 04:40:18 2007
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Version.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Version.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Version.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/Version.pm Sat Nov 24 04:40:18 2007
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/YAML.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/YAML.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/YAML.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Result/YAML.pm Sat Nov 24 04:40:18 2007
@@ -12,11 +12,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source.pm Sat Nov 24 04:40:18 2007
@@ -14,11 +14,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source/Perl.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source/Perl.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source/Perl.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/Source/Perl.pm Sat Nov 24 04:40:18 2007
@@ -16,11 +16,11 @@
 
 =head1 VERSION
 
-Version 3.02
-
-=cut
-
-$VERSION = '3.02';
+Version 3.03
+
+=cut
+
+$VERSION = '3.03';
 
 =head1 DESCRIPTION
 
@@ -189,6 +189,64 @@
     return map {"-I$_"} grep {$_} @_;
 }
 
+=head3 C<shebang>
+
+Get the shebang line for a script file.
+
+    my $shebang = TAP::Parser::Source::Perl->shebang( $some_script );
+
+May be called as a class method
+
+=cut
+
+{
+
+    # Global shebang cache.
+    my %shebang_for;
+
+    sub _read_shebang {
+        my $file = shift;
+        local *TEST;
+        my $shebang;
+        if ( open( TEST, $file ) ) {
+            $shebang = <TEST>;
+            close(TEST) or print "Can't close $file. $!\n";
+        }
+        else {
+            print "Can't open $file. $!\n";
+        }
+        return $shebang;
+    }
+
+    sub shebang {
+        my ( $class, $file ) = @_;
+        unless ( exists $shebang_for{$file} ) {
+            $shebang_for{$file} = _read_shebang($file);
+        }
+        return $shebang_for{$file};
+    }
+}
+
+=head3 C<get_taint>
+
+Decode any taint switches from a Perl shebang line.
+
+    # $taint will be 't'
+    my $taint = TAP::Parser::Source::Perl->get_taint( '#!/usr/bin/perl -t' );
+
+    # $untaint will be undefined
+    my $untaint = TAP::Parser::Source::Perl->get_taint( '#!/usr/bin/perl' );    
+
+=cut
+
+sub get_taint {
+    my ( $class, $shebang ) = @_;
+    return
+      unless defined $shebang
+          && $shebang =~ /^#!.*\bperl.*\s-\w*([Tt]+)/;
+    return $1;
+}
+
 sub _switches {
     my $self     = shift;
     my $file     = $self->source_file;
@@ -196,15 +254,11 @@
         $self->switches,
     );
 
-    local *TEST;
-    open( TEST, $file ) or print "can't open $file. $!\n";
-    my $shebang = <TEST>;
-    close(TEST) or print "can't close $file. $!\n";
-
+    my $shebang = $self->shebang($file);
     return unless defined $shebang;
 
-    my $taint = ( $shebang =~ /^#!.*\bperl.*\s-\w*([Tt]+)/ );
-    push @switches, "-$1" if $taint;
+    my $taint = $self->get_taint($shebang);
+    push @switches, "-$taint" if defined $taint;
 
     # Quote the argument if there's any whitespace in it, or if
     # we're VMS, since VMS requires all parms quoted.  Also, don't quote

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Reader.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Reader.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Reader.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Reader.pm Sat Nov 24 04:40:18 2007
@@ -4,7 +4,7 @@
 
 use vars qw{$VERSION};
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 # TODO:
 #   Handle blessed object syntax
@@ -277,7 +277,7 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Writer.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Writer.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Writer.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/TAP/Parser/YAMLish/Writer.pm Sat Nov 24 04:40:18 2007
@@ -4,7 +4,7 @@
 
 use vars qw{$VERSION};
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 my $ESCAPE_CHAR = qr{ [ \x00-\x1f \" ] }x;
 
@@ -147,7 +147,7 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-harness-perl/current/lib/Test/Harness.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/lib/Test/Harness.pm?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/lib/Test/Harness.pm (original)
+++ branches/upstream/libtest-harness-perl/current/lib/Test/Harness.pm Sat Nov 24 04:40:18 2007
@@ -7,8 +7,9 @@
 use constant IS_WIN32 => ( $^O =~ /^(MS)?Win32$/ );
 use constant IS_VMS => ( $^O eq 'VMS' );
 
-use TAP::Harness            ();
-use TAP::Parser::Aggregator ();
+use TAP::Harness              ();
+use TAP::Parser::Aggregator   ();
+use TAP::Parser::Source::Perl ();
 
 use Config;
 use Exporter;
@@ -39,11 +40,11 @@
 
 =head1 VERSION
 
-Version 3.02
+Version 3.03
 
 =cut
 
-$VERSION = '3.02';
+$VERSION = '3.03';
 
 # Backwards compatibility for exportable variable names.
 *verbose  = *Verbose;
@@ -108,6 +109,12 @@
 
 =cut
 
+sub _has_taint {
+    my $test = shift;
+    return TAP::Parser::Source::Perl->get_taint(
+        TAP::Parser::Source::Perl->shebang($test) );
+}
+
 sub _aggregate {
     my ( $harness, $aggregate, @tests ) = @_;
 
@@ -124,6 +131,16 @@
         my $path_sep  = $Config{path_sep};
         my $path_pat  = qr{$path_sep};
         my @extra_inc = _filtered_inc();
+
+        # Supply -I switches in taint mode
+        $harness->callback(
+            parser_args => sub {
+                my ( $test, $args ) = @_;
+                if ( _has_taint($test) ) {
+                    push @{ $args->{switches} }, map {"-I$_"} _filtered_inc();
+                }
+            }
+        );
 
         my $previous = $ENV{PERL5LIB};
         local $ENV{PERL5LIB};

Modified: branches/upstream/libtest-harness-perl/current/t/harness.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/t/harness.t?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/t/harness.t (original)
+++ branches/upstream/libtest-harness-perl/current/t/harness.t Sat Nov 24 04:40:18 2007
@@ -299,7 +299,7 @@
 
     my @callback_log = ();
 
-    for my $evt (qw(made_parser before_runtests after_runtests)) {
+    for my $evt (qw(parser_args made_parser before_runtests after_runtests)) {
         $harness->callback(
             $evt => sub {
                 push @callback_log, $evt;
@@ -363,7 +363,7 @@
     cmp_ok( $callback_count, '==', 1, 'callback called once' );
     is_deeply(
         \@callback_log,
-        [ 'before_runtests', 'made_parser', 'after_runtests' ],
+        [ 'before_runtests', 'parser_args', 'made_parser', 'after_runtests' ],
         'callback log matches'
     );
     isa_ok $parser, 'TAP::Parser';

Modified: branches/upstream/libtest-harness-perl/current/t/parse.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/t/parse.t?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/t/parse.t (original)
+++ branches/upstream/libtest-harness-perl/current/t/parse.t Sat Nov 24 04:40:18 2007
@@ -519,7 +519,7 @@
 
     is @die, 1, 'coverage testing for _initialize';
 
-    like pop @die, qr/PANIC:  could not determine stream at/,
+    like pop @die, qr/PANIC:\s+could not determine stream at/,
       '...and it failed as expected';
 
     @die = ();

Modified: branches/upstream/libtest-harness-perl/current/t/process.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/t/process.t?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/t/process.t (original)
+++ branches/upstream/libtest-harness-perl/current/t/process.t Sat Nov 24 04:40:18 2007
@@ -18,11 +18,11 @@
 
 my @expect = (
     '1..5',
-    'ok 1',
+    'ok 1 00000',
     'ok 2',
     'not ok 3',
     'ok 4',
-    'ok 5',
+    'ok 5 00000',
 );
 
 my $source = File::Spec->catfile( 't', 'sample-tests', 'delayed' );

Modified: branches/upstream/libtest-harness-perl/current/t/sample-tests/delayed
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-harness-perl/current/t/sample-tests/delayed?rev=9703&op=diff
==============================================================================
--- branches/upstream/libtest-harness-perl/current/t/sample-tests/delayed (original)
+++ branches/upstream/libtest-harness-perl/current/t/sample-tests/delayed Sat Nov 24 04:40:18 2007
@@ -9,11 +9,11 @@
 my @parts = (
     "1.",
     ".5\n",
-    "ok 1\n",
+    "ok 1 00000\n",
     "ok 2\nnot",
     " ok 3",
     "\nok 4\nok ",
-    "5",
+    "5 00000",
     ""
 );
 




More information about the Pkg-perl-cvs-commits mailing list