This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix perldiag entry for CORE::dump()
[perl5.git] / TestInit.pm
index 814c99c..f9a5e91 100644 (file)
@@ -27,6 +27,8 @@ $VERSION = 1.04;
 # http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-07/msg00154.html
 $ENV{PERL_CORE} = $^X;
 
+$0 =~ s/\.dp$//; # for the test.deparse make target
+
 sub import {
     my $self = shift;
     my @up_2_t = ('../../lib', '../../t');
@@ -45,7 +47,7 @@ sub import {
        } elsif ($_ eq 'T') {
            $chdir = '..'
                unless -f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext';
-           @INC = 'lib';
+           @INC = qw/ lib . /;
            $setopt = 1;
        } else {
            die "Unknown option '$_'";
@@ -65,7 +67,7 @@ sub import {
                $chdir = $1;
                @INC = @up_2_t;
                $setopt = 1;
-               $^X =~ s!^\.([/\\])!..$1..$1!;
+               $^X =~ s!^\.([\\/])!..$1..$1!;
            } else {
                $chdir = 't';
                @INC = '../lib';
@@ -74,7 +76,16 @@ sub import {
        } else {
            # (likely) we're being run by t/TEST or t/harness, and we're a test
            # in t/
-           @INC = '../lib';
+           if (defined &DynaLoader::boot_DynaLoader) {
+               @INC = '../lib';
+           }
+           else {
+               # miniperl/minitest
+               # t/TEST does not supply -I../lib, so buildcustomize.pl is
+               # not automatically included.
+               unshift @INC, '../lib';
+               do "../lib/buildcustomize.pl";
+           }
        }
     }
 
@@ -110,5 +121,4 @@ sub import {
     push @INC, '.' unless ${^TAINT};
 }
 
-$0 =~ s/\.dp$//; # for the test.deparse make target
 1;