Subject: | Tests fail if Perl was built with SDK older than current Mac OS X |
Hi,
following the fix in XS code to check for MAC_OSX_MIN_VERSION the tests
also need updating as they only check system Mac OS X version before
attempting to import functions.
The attached patch has been tested on Mac OS X 10.6 and confirmed to do
the right thing against the system Perl (all functions are imported) and
against a Perl built using 10.4u SDK (only functions up to 10.4 are
imported).
Regards
Mark
Subject: | macsysdir.patch |
diff -ruNw Mac-SystemDirectory-0.05/t/005_import.t Mac-SystemDirectory-0.05a/t/005_import.t
--- Mac-SystemDirectory-0.05/t/005_import.t 2011-02-02 09:39:05.000000000 +0000
+++ Mac-SystemDirectory-0.05a/t/005_import.t 2011-02-08 20:19:57.000000000 +0000
@@ -5,11 +5,22 @@
use Test::More tests => 1;
my $minor = 0;
+my $sdk = 0;
if ( -f '/usr/bin/sw_vers' && -x _ ) {
($minor) = (qx</usr/bin/sw_vers -productVersion> =~ /\A\d+\.(\d+)\.\d+/);
}
+#check for sdk version passed to xs build
+require Config;
+if($Config::Config{ccflags} =~ m/-mmacosx-version-min=10\.(\d)/) {
+ $sdk = $1;
+}
+
+my $featureversion = $sdk || $minor;
+
+diag(qq(limiting available functions to Mac OS X 10.$featureversion)) if $featureversion && defined(&Test::More::diag);
+
my @import = (
# Functions
qw( FindDirectory
@@ -46,10 +57,10 @@
NSCachesDirectory
NSApplicationSupportDirectory
) : (),
- ($minor >= 5) ?
+ ( $featureversion >= 5 ) ?
qw( NSDownloadsDirectory
) : (),
- ($minor >= 6) ?
+ ( $featureversion >= 6 ) ?
qw( NSInputMethodsDirectory
NSMoviesDirectory
NSMusicDirectory