ExtUtils::ParseXS: Fix tests for native android builds
authorBrian Fraser <fraserbn@gmail.com>
Tue, 21 Jan 2014 17:09:58 +0000 (14:09 -0300)
committerBrian Fraser <fraserbn@gmail.com>
Sun, 26 Jan 2014 17:44:25 +0000 (14:44 -0300)
dist/ExtUtils-ParseXS/t/001-basic.t
dist/ExtUtils-ParseXS/t/002-more.t
dist/ExtUtils-ParseXS/t/003-usage.t

index e6d9808..9b2d204 100644 (file)
@@ -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
index a612412..e4a68f2 100644 (file)
@@ -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';
index 57d5140..bfe10ac 100644 (file)
@@ -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';