From: Gabor Szabo Date: Fri, 12 Feb 2010 05:27:59 +0000 (-0800) Subject: Bug 545762: Allow tests to pass when using the PERL5LIB environment variable. X-Git-Tag: bugzilla-3.6rc1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c52b4ca41e40e719f0401e531d88d5023d0328;p=thirdparty%2Fbugzilla.git Bug 545762: Allow tests to pass when using the PERL5LIB environment variable. r=mkanat, a=mkanat --- diff --git a/t/001compile.t b/t/001compile.t index 3e42734921..9e63da0b48 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;