From 848ac64bdec15c679437aa9954aa33832acb28c7 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Tue, 21 Jan 2014 14:09:58 -0300 Subject: [PATCH] ExtUtils::ParseXS: Fix tests for native android builds --- dist/ExtUtils-ParseXS/t/001-basic.t | 8 ++++++++ dist/ExtUtils-ParseXS/t/002-more.t | 4 ++++ dist/ExtUtils-ParseXS/t/003-usage.t | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/dist/ExtUtils-ParseXS/t/001-basic.t b/dist/ExtUtils-ParseXS/t/001-basic.t index e6d9808..9b2d204 100644 --- a/dist/ExtUtils-ParseXS/t/001-basic.t +++ b/dist/ExtUtils-ParseXS/t/001-basic.t @@ -14,6 +14,14 @@ chdir('t') if -d 't'; use Carp; $SIG{__WARN__} = \&Carp::cluck; +# Some trickery for Android. If we leave @INC as-is, it'll have '.' in it. +# Later on, the 'require XSTest' end up in DynaLoader looking for +# ./PL_XSTest.so, but unless our current directory happens to be in +# LD_LIBRARY_PATH, Android's linker will never find the file, and the test +# will fail. Instead, if we have all absolute paths, it'll just work. +@INC = map { File::Spec->rel2abs($_) } @INC + if $^O =~ /android/; + ######################### { # first block: try without linenumbers diff --git a/dist/ExtUtils-ParseXS/t/002-more.t b/dist/ExtUtils-ParseXS/t/002-more.t index a612412..e4a68f2 100644 --- a/dist/ExtUtils-ParseXS/t/002-more.t +++ b/dist/ExtUtils-ParseXS/t/002-more.t @@ -20,6 +20,10 @@ chdir 't' if -d 't'; use Carp; $SIG{__WARN__} = \&Carp::cluck; +# See the comments about this in 001-basics.t +@INC = map { File::Spec->rel2abs($_) } @INC + if $^O =~ /android/; + ######################### $source_file = 'XSMore.c'; diff --git a/dist/ExtUtils-ParseXS/t/003-usage.t b/dist/ExtUtils-ParseXS/t/003-usage.t index 57d5140..bfe10ac 100644 --- a/dist/ExtUtils-ParseXS/t/003-usage.t +++ b/dist/ExtUtils-ParseXS/t/003-usage.t @@ -21,6 +21,10 @@ chdir('t') if -d 't'; use Carp; $SIG{__WARN__} = \&Carp::cluck; +# See the comments about this in 001-basics.t +@INC = map { File::Spec->rel2abs($_) } @INC + if $^O =~ /android/; + ######################### $source_file = 'XSUsage.c'; -- 2.7.4