From dc4e122eaf5710d1af8ddd48ef4cb747efaaa9a9 Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Thu, 11 Feb 2010 21:26:35 -0800 Subject: Bug 545762: Allow tests to pass when using the PERL5LIB environment variable. r=mkanat, a=mkanat --- t/001compile.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 't/001compile.t') 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; -- cgit v1.2.3-24-g4f1b