X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/30b6e59101b252c20a6b50b95203d1e2c6016604..7cf8bfc08bba55cf85781cc2cdb8d5ace99245ec:/TestInit.pm diff --git a/TestInit.pm b/TestInit.pm index 3d03ed8..8513955 100644 --- a/TestInit.pm +++ b/TestInit.pm @@ -59,12 +59,13 @@ if (-f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext') { # We're being run from the top level. Try to change directory, and set # things up correctly. This is a 90% solution, but for hand-running tests, # that's good enough - if ($0 =~ s!(ext[\\/][^\\/]+)[\//](.*\.t)$!$2!) { + if ($0 =~ s!^((?:ext|dist|cpan)[\\/][^\\/]+)[\//](.*\.t)$!$2!) { # Looks like a test in ext. chdir $1 or die "Can't chdir '$1': $!"; new_inc(@up_2_t); - $^X =~ s!^\./!../../perl!; - $^X =~ s!^\.\\!..\\..\\perl!; + set_opt(@up_2_t); + $^X =~ s!^\./!../../!; + $^X =~ s!^\.\\!..\\..\\!; } else { chdir 't' or die "Can't chdir 't': $!"; new_inc('../lib');