This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Based on a patch by John E. Malberg: make TestInit.pm
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 3 Nov 2007 10:12:06 +0000 (10:12 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 3 Nov 2007 10:12:06 +0000 (10:12 +0000)
use an absolute path in @INC, so that changes of directories
don't break dynamically loaded modules.

p4raw-id: //depot/perl@32214

t/TestInit.pm

index aa76fe1..058ad29 100644 (file)
@@ -18,7 +18,13 @@ package TestInit;
 $VERSION = 1.01;
 
 chdir 't' if -d 't';
-@INC = '../lib';
+if ($^O eq 'VMS') {
+    require File::Spec;
+    @INC = File::Spec->rel2abs('[-.lib]');
+}
+else {
+    @INC = '../lib';
+}
 
 # Don't interfere with the taintedness of %ENV, this could perturbate tests
 $ENV{PERL_CORE} = 1 unless ${^TAINT};