From: Vincent Pit Date: Wed, 11 Mar 2015 14:37:53 +0000 (-0300) Subject: Always preserve $ENV{$Config{ldlibpthname}} X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3d20039698dc108e2111d69c4c73e6fa9cc5c091;p=perl%2Fmodules%2FVPIT-TestHelpers.git Always preserve $ENV{$Config{ldlibpthname}} --- diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index 91de044..c147f80 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -113,9 +113,9 @@ sub run_perl { my $ldlibpth = $ENV{$ld_name}; local %ENV; + $ENV{$ld_name} = $ldlibpth if defined $ldlibpth; $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot; $ENV{PATH} = $PATH if $^O eq 'cygwin' and defined $PATH; - $ENV{$ld_name} = $ldlibpth if $^O eq 'android' and defined $ldlibpth; system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code; } diff --git a/t/30-run_perl.t b/t/30-run_perl.t index b71f7be..cd040e1 100644 --- a/t/30-run_perl.t +++ b/t/30-run_perl.t @@ -5,7 +5,7 @@ use warnings; use VPIT::TestHelpers; -use Test::More tests => 4; +use Test::More tests => 5; use Config; use File::Temp; @@ -18,10 +18,12 @@ my $ld_path = $Config::Config{ldlibpthname}; my %expected_vars = ( 'MSWin32' => [ qw ], - 'android' => [ $ld_path ], + 'android' => [ ], 'cygwin' => [ qw ], + 'darwin' => [ ], 'linux' => [ ], ); +push @$_, $ld_path for values %expected_vars; my @all_vars = do { my %uniq; @@ -35,7 +37,7 @@ my @ignored_vars = qw< __CF_USER_TEXT_ENCODING >; -for my $os (qw) { +for my $os (qw) { 1 while unlink $filename; local $^O = $os;