summaryrefslogtreecommitdiff
path: root/cpan/Test-Harness
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-06-29 15:52:27 +0100
committerNicholas Clark <nick@ccl4.org>2010-06-29 15:52:27 +0100
commit175dcccfb62b30facb2b6aa0185dde20a805b549 (patch)
tree125204c00b68139c266a2c8dc5bc93dbf8d1b7c5 /cpan/Test-Harness
parenta642fc51b9c225f75f859da6a69df0b4ac81d396 (diff)
downloadperl-175dcccfb62b30facb2b6aa0185dde20a805b549.tar.gz
Fix 3 remaining Test::Harness tests to work in core.
Diffstat (limited to 'cpan/Test-Harness')
-rw-r--r--cpan/Test-Harness/t/lib/MyShebangger.pm5
-rw-r--r--cpan/Test-Harness/t/regression.t3
-rw-r--r--cpan/Test-Harness/t/source_handler.t2
-rw-r--r--cpan/Test-Harness/t/source_tests/source1
-rw-r--r--cpan/Test-Harness/t/taint.t2
5 files changed, 9 insertions, 4 deletions
diff --git a/cpan/Test-Harness/t/lib/MyShebangger.pm b/cpan/Test-Harness/t/lib/MyShebangger.pm
index 074a2e187a..1606ea50e3 100644
--- a/cpan/Test-Harness/t/lib/MyShebangger.pm
+++ b/cpan/Test-Harness/t/lib/MyShebangger.pm
@@ -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,^\#!,,;
}
diff --git a/cpan/Test-Harness/t/regression.t b/cpan/Test-Harness/t/regression.t
index 498f3de62a..b952ef5df3 100644
--- a/cpan/Test-Harness/t/regression.t
+++ b/cpan/Test-Harness/t/regression.t
@@ -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;
diff --git a/cpan/Test-Harness/t/source_handler.t b/cpan/Test-Harness/t/source_handler.t
index d38f094334..1287a9f11b 100644
--- a/cpan/Test-Harness/t/source_handler.t
+++ b/cpan/Test-Harness/t/source_handler.t
@@ -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,
diff --git a/cpan/Test-Harness/t/source_tests/source b/cpan/Test-Harness/t/source_tests/source
index a176152174..dd5369c326 100644
--- a/cpan/Test-Harness/t/source_tests/source
+++ b/cpan/Test-Harness/t/source_tests/source
@@ -2,6 +2,7 @@
BEGIN {
unshift @INC, 't/lib';
+ unshift @INC, '../../lib' if $ENV{PERL_CORE};
}
use Test::More tests => 1;
diff --git a/cpan/Test-Harness/t/taint.t b/cpan/Test-Harness/t/taint.t
index 26e46320e2..a535983645 100644
--- a/cpan/Test-Harness/t/taint.t
+++ b/cpan/Test-Harness/t/taint.t
@@ -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