]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/commitdiff
Save LD_LIBRARY_PATH for Android on t/51-threads-teardown.t
authorBrian Fraser <fraserbn@gmail.com>
Sat, 2 Aug 2014 15:42:24 +0000 (17:42 +0200)
committerVincent Pit <vince@profvince.com>
Mon, 1 Sep 2014 12:43:19 +0000 (14:43 +0200)
In Android, LD_LIBRARY_PATH must have the location of
libperl.so, otherwise perl will have a linking error
and simply won't work.

lib/VPIT/TestHelpers.pm

index 30c6bc02c5a841742397efd3f06de4440b753c46..91de04459f69425f1f6a425ced54160b621461ca 100644 (file)
@@ -3,6 +3,8 @@ package VPIT::TestHelpers;
 use strict;
 use warnings;
 
 use strict;
 use warnings;
 
+use Config ();
+
 my %exports = (
  load_or_skip     => \&load_or_skip,
  load_or_skip_all => \&load_or_skip_all,
 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<SystemRoot PATH>};
  my $code = shift;
 
  my ($SystemRoot, $PATH) = @ENV{qw<SystemRoot PATH>};
+ 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;
  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;
 }
 
  system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code;
 }