This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix 3 remaining Test::Harness tests to work in core.
authorNicholas Clark <nick@ccl4.org>
Tue, 29 Jun 2010 14:52:27 +0000 (15:52 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 29 Jun 2010 14:52:27 +0000 (15:52 +0100)
cpan/Test-Harness/t/lib/MyShebangger.pm
cpan/Test-Harness/t/regression.t
cpan/Test-Harness/t/source_handler.t
cpan/Test-Harness/t/source_tests/source
cpan/Test-Harness/t/taint.t

index 074a2e1..1606ea5 100644 (file)
@@ -40,7 +40,10 @@ sub fix_shebang {
     die "$file_in is not perl"
       unless $cmd =~ m{^perl(?:\z|[^a-z])};
 
-    if ( $Config{startperl} =~ m,^\#!.*/perl, ) {
+    if ($ENV{PERL_CORE}) {
+        $interpreter = $^X;
+    }
+    elsif ( $Config{startperl} =~ m,^\#!.*/perl, ) {
         $interpreter = $Config{startperl};
         $interpreter =~ s,^\#!,,;
     }
index 498f3de..b952ef5 100644 (file)
@@ -3160,7 +3160,8 @@ for my $hide_fork ( 0 .. $can_open3 ) {
         # Test::Builder::failure_output() method to be overridden when
         # TAP::Parser is not installed.  Otherwise, these tests will fail.
 
-        unshift @{ $args->{switches} }, '-It/lib';
+        unshift @{ $args->{switches} },
+          $ENV{PERL_CORE} ? ( map {"-I$_"} @INC ) : ('-It/lib');
 
         $args->{source} = File::Spec->catfile( $SAMPLE_TESTS, $test );
         $args->{merge} = !$hide_fork;
index d38f094..1287a9f 100644 (file)
@@ -84,7 +84,7 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
         ],
         make_iterator => [
             {   name   => "valid executable",
-                raw    => [ $perl, '-It/lib', '-T', $file{source} ],
+                raw    => [ $perl, '-I../../lib', '-It/lib', '-T', $file{source} ],
                 iclass => 'TAP::Parser::Iterator::Process',
                 output        => [ '1..1', 'ok 1 - source' ],
                 assemble_meta => 1,
index a176152..dd5369c 100644 (file)
@@ -2,6 +2,7 @@
 
 BEGIN {
   unshift @INC, 't/lib';
+  unshift @INC, '../../lib' if $ENV{PERL_CORE};
 }
 
 use Test::More tests => 1;
index 26e4632..a535983 100644 (file)
@@ -37,7 +37,7 @@ sub run_test_file {
 }
 
 {
-    local $ENV{PERL5OPT} = '-Mstrict';
+    local $ENV{PERL5OPT} = $ENV{PERL_CORE} ? '-I../../lib -Mstrict' : '-Mstrict';
     run_test_file(<<'END');
 #!/usr/bin/perl -T