]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 545762: Allow tests to pass when using the PERL5LIB environment variable.
authorGabor Szabo <szabgab@gmail.com>
Fri, 12 Feb 2010 05:27:59 +0000 (21:27 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Fri, 12 Feb 2010 05:27:59 +0000 (21:27 -0800)
r=mkanat, a=mkanat

t/001compile.t

index 3e42734921a72207d2c939aa835daa86ab1e1818..9e63da0b489d151975b3c79eea36521ea7fbc446 100644 (file)
@@ -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;