From: Brian Fraser Date: Sat, 2 Aug 2014 15:42:24 +0000 (+0200) Subject: Save LD_LIBRARY_PATH for Android on t/51-threads-teardown.t X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4fb1879240a13d6dc25d0f5d5dd6c32cde3640cc;p=perl%2Fmodules%2FVPIT-TestHelpers.git Save LD_LIBRARY_PATH for Android on t/51-threads-teardown.t In Android, LD_LIBRARY_PATH must have the location of libperl.so, otherwise perl will have a linking error and simply won't work. --- diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index 30c6bc0..91de044 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -3,6 +3,8 @@ package VPIT::TestHelpers; use strict; use warnings; +use Config (); + my %exports = ( load_or_skip => \&load_or_skip, load_or_skip_all => \&load_or_skip_all, @@ -107,9 +109,13 @@ sub run_perl { my $code = shift; my ($SystemRoot, $PATH) = @ENV{qw}; + my $ld_name = $Config::Config{ldlibpthname}; + my $ldlibpth = $ENV{$ld_name}; + local %ENV; $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; }