This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ensure that chdir.t can find File::Spec and Cwd under minitest
authorNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 17:50:36 +0000 (17:50 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 20:39:56 +0000 (20:39 +0000)
As a working chdir is a key part of the build process, it would be counter-
productive to skip testing it if the build process failed, because it might be
cause of the problems. So add the source locations for Cwd and File::Spec in
dist/Cwd and dist/Cwd/lib respectively.

t/op/chdir.t

index a0c60bf..2c6535b 100644 (file)
@@ -5,11 +5,16 @@ BEGIN {
     # chdir() works!  Instead, we'll hedge our bets and put both
     # possibilities into @INC.
     @INC = qw(t . lib ../lib);
+    require "test.pl";
+    # Really want to know if chdir is working, as the build process will all go
+    # wrong if it is not.
+    if (is_miniperl() && !eval {require File::Spec::Functions; 1}) {
+       push @INC, qw(dist/Cwd/lib dist/Cwd ../dist/Cwd/lib ../dist/Cwd);
+    }
+    plan(tests => 48);
 }
 
 use Config;
-require "test.pl";
-plan(tests => 48);
 
 my $IsVMS   = $^O eq 'VMS';