Skip Menu |

This queue is for tickets about the Mac-SystemDirectory CPAN distribution.

Report information
The Basics
Id: 65573
Status: resolved
Priority: 0/
Queue: Mac-SystemDirectory

People
Owner: Nobody in particular
Requestors: mdootson [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



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
Vid Tue, 08 Feb 2011 kl. 15.33.24, skrev MDOOTSON: Hi Mark, Show quoted text
> 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).
Thanks Mark! I have applied your patch and shipped a new version to CPAN. Regards chansen