summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/001compile.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/001compile.t b/t/001compile.t
index 3e4273492..9e63da0b4 100644
--- a/t/001compile.t
+++ b/t/001compile.t
@@ -27,6 +27,7 @@
use strict;
use 5.008001;
use lib qw(. lib t);
+use Config;
use Support::Files;
use Test::More tests => scalar(@Support::Files::testitems);
@@ -59,8 +60,12 @@ sub compile_file {
$T = "T";
}
+ my $libs = '';
+ if ($ENV{PERL5LIB}) {
+ $libs = join " ", map { "-I$_" } split /$Config{path_sep}/, $ENV{PERL5LIB};
+ }
my $perl = qq{"$^X"};
- my $output = `$perl -wc$T $file 2>&1`;
+ my $output = `$perl $libs -wc$T $file 2>&1`;
chomp($output);
my $return_val = $?;
$output =~ s/^\Q$file\E syntax OK$//ms;