Change 16938 by pudge@pudge-mobile on 2002/05/31 20:46:07

        Big MacPerl Testing Patch No. 3

Affected files ...

.... //depot/macperl/lib/ExtUtils/MM_MacOS.pm#5 edit
.... //depot/macperl/lib/File/DosGlob.t#2 edit
.... //depot/macperl/lib/File/Spec/t/Spec.t#2 edit
.... //depot/macperl/lib/Test/Harness/Straps.pm#9 edit
.... //depot/macperl/lib/Test/Harness/t/callback.t#4 edit
.... //depot/macperl/lib/Test/Harness/t/strap-analyze.t#9 edit
.... //depot/macperl/lib/Test/Harness/t/test-harness.t#9 edit
.... //depot/macperl/lib/lib_pm.PL#3 edit
.... //depot/macperl/t/comp/use.t#2 edit
.... //depot/macperl/utils/dprofpp.PL#2 edit
.... //depot/macperl/utils/splain.PL#2 edit

Differences ...

==== //depot/macperl/lib/ExtUtils/MM_MacOS.pm#5 (text) ====
Index: macperl/lib/ExtUtils/MM_MacOS.pm
--- macperl/lib/ExtUtils/MM_MacOS.pm#4~16929~   Fri May 31 09:27:30 2002
+++ macperl/lib/ExtUtils/MM_MacOS.pm    Fri May 31 13:46:07 2002
@@ -12,7 +12,7 @@
 @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
 
 use vars qw($VERSION);
-$VERSION = '1.01';
+$VERSION = '1.03';
 
 use Config;
 use Cwd 'cwd';
@@ -21,6 +21,8 @@
 use File::Spec;
 use vars qw(%make_data);
 
+my $Mac_FS = eval { require Mac::FileSpec::Unixish };
+
 use ExtUtils::MakeMaker qw($Verbose &neatvalue);
 
 =head1 NAME
@@ -242,7 +244,7 @@
 sub macify {
     # mmm, better ... and this condition should always be satisified,
     # as the module is now distributed with MacPerl, but leave in anyway
-    if (do 'Mac/FileSpec/Unixish.pm') {
+    if ($Mac_FS) {
         return Mac::FileSpec::Unixish::nativize($_[0]);
     }
 
@@ -606,7 +608,11 @@
              XSPROTOARG MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC 
MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED SOURCE TYPEMAPS
              / ) {
        next unless defined $self->{$tmp};
-       push @m, "$tmp = $self->{$tmp}\n";
+       if ($tmp eq 'TYPEMAPS' && ref $self->{$tmp}) {
+           push @m, sprintf "$tmp = %s\n", join " ", @{$self->{$tmp}};
+       } else {
+           push @m, "$tmp = $self->{$tmp}\n";
+       }
     }
 
     push @m, q{

==== //depot/macperl/lib/File/DosGlob.t#2 (xtext) ====
Index: macperl/lib/File/DosGlob.t
--- macperl/lib/File/DosGlob.t#1~16123~ Tue Apr 23 18:25:17 2002
+++ macperl/lib/File/DosGlob.t  Fri May 31 13:46:07 2002
@@ -21,7 +21,6 @@
 } else {
     $expected = $_ = "op/a*.t";
 }
-$_ = "op/a*.t";
 my @r = glob;
 print "not " if $_ ne $expected;
 print "ok 1\n";
@@ -94,7 +93,8 @@
 package Foo;
 use File::DosGlob 'glob';
 @s = ();
-while (glob '*/a*.t') {
+$pat = $^O eq 'MacOS' ? ':*:a*.t' : '*/a*.t';
+while (glob($pat)) {
     print "# $_\n";
     push @s, $_;
 }
@@ -103,15 +103,28 @@
 
 # test if different glob ops maintain independent contexts
 @s = ();
-while (<*/a*.t>) {
-    my $i = 0;
-    print "# $_ <";
-    push @s, $_;
-    while (<*/b*.t>) {
-        print " $_";
-       $i++;
+if ($^O eq 'MacOS') {
+    while (<:*:a*.t>) {
+       my $i = 0;
+       print "# $_ <";
+       push @s, $_;
+       while (<:*:b*.t>) {
+           print " $_";
+           $i++;
+       }
+       print " >\n";
+    }
+} else {
+    while (<*/a*.t>) {
+       my $i = 0;
+       print "# $_ <";
+       push @s, $_;
+       while (<*/b*.t>) {
+           print " $_";
+           $i++;
+       }
+       print " >\n";
     }
-    print " >\n";
 }
 print "not " if "@r" ne "@s";
 print "ok 9\n";
@@ -121,15 +134,28 @@
 use File::DosGlob 'GLOBAL_glob';
 package Bar;
 @s = ();
-while (<*/a*.t>) {
-    my $i = 0;
-    print "# $_ <";
-    push @s, $_;
-    while (glob '*/b*.t') {
-        print " $_";
-       $i++;
+if ($^O eq 'MacOS') {
+    while (<:*:a*.t>) {
+       my $i = 0;
+       print "# $_ <";
+       push @s, $_;
+       while (glob ':*:b*.t') {
+           print " $_";
+           $i++;
+       }
+       print " >\n";
+    }
+} else {
+    while (<*/a*.t>) {
+       my $i = 0;
+       print "# $_ <";
+       push @s, $_;
+       while (glob '*/b*.t') {
+           print " $_";
+           $i++;
+       }
+       print " >\n";
     }
-    print " >\n";
 }
 print "not " if "@r" ne "@s";
 print "ok 10\n";

==== //depot/macperl/lib/File/Spec/t/Spec.t#2 (text) ====
Index: macperl/lib/File/Spec/t/Spec.t
--- macperl/lib/File/Spec/t/Spec.t#1~16123~     Tue Apr 23 18:25:17 2002
+++ macperl/lib/File/Spec/t/Spec.t      Fri May 31 13:46:07 2002
@@ -3,6 +3,9 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
+    if ($^O eq 'MacOS') {
+       push @INC, "::lib:$MacPerl::Architecture";
+    }
 }
 # Grab all of the plain routines from File::Spec
 use File::Spec @File::Spec::EXPORT_OK ;
@@ -37,7 +40,6 @@
 # tests are skipped on other OSs
 my $root;
 if ($^O eq 'MacOS') {
-       push @INC, "::lib:$MacPerl::Architecture";
        $root = File::Spec::Mac->rootdir();
 }
 

==== //depot/macperl/lib/Test/Harness/Straps.pm#9 (text) ====
Index: macperl/lib/Test/Harness/Straps.pm
--- macperl/lib/Test/Harness/Straps.pm#8~16929~ Fri May 31 09:27:30 2002
+++ macperl/lib/Test/Harness/Straps.pm  Fri May 31 13:46:07 2002
@@ -328,8 +328,11 @@
 
     # When taint mode is on, PERL5LIB is ignored.  So we need to put
     # all that on the command line as -Is.
-    $s .= join " ", qq[ "-$1"], map {qq["-I$_"]} $self->_filtered_INC
-      if $first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/;
+    if ($first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/) {
+      $s .= join " ", qq[ "-$1"], map {qq["-I$_"]} $self->_filtered_INC;
+    } elsif ($^O eq 'MacOS') {
+      $s .= join " ", map {qq["-I$_"]} $self->_filtered_INC;
+    }
 
     close(TEST) or print "can't close $file. $!\n";
 

==== //depot/macperl/lib/Test/Harness/t/callback.t#4 (text) ====
Index: macperl/lib/Test/Harness/t/callback.t
--- macperl/lib/Test/Harness/t/callback.t#3~16929~      Fri May 31 09:27:30 2002
+++ macperl/lib/Test/Harness/t/callback.t       Fri May 31 13:46:07 2002
@@ -10,7 +10,11 @@
     }
 }
 
-my $SAMPLE_TESTS = $ENV{PERL_CORE} ? 'lib/sample-tests' : 't/sample-tests';
+use File::Spec::Functions;
+
+my $SAMPLE_TESTS = $ENV{PERL_CORE}
+    ? catdir(curdir(), 'lib', 'sample-tests')
+    : catdir(curdir(), 't', 'sample-tests');
 
 use Test::More;
 
@@ -50,7 +54,7 @@
                             
 while( my($test, $expect) = each %samples ) {
     local @out = ();
-    $strap->analyze_file("$SAMPLE_TESTS/$test");
+    $strap->analyze_file(catfile($SAMPLE_TESTS, $test));
 
     is_deeply(\@out, $expect,   "$test callback");
 }

==== //depot/macperl/lib/Test/Harness/t/strap-analyze.t#9 (text) ====
Index: macperl/lib/Test/Harness/t/strap-analyze.t
--- macperl/lib/Test/Harness/t/strap-analyze.t#8~16929~ Fri May 31 09:27:30 2002
+++ macperl/lib/Test/Harness/t/strap-analyze.t  Fri May 31 13:46:07 2002
@@ -10,11 +10,19 @@
     }
 }
 
-my $SAMPLE_TESTS = $ENV{PERL_CORE} ? 'lib/sample-tests' : 't/sample-tests';
+use File::Spec::Functions;
+
+my $SAMPLE_TESTS = $ENV{PERL_CORE}
+    ? catdir(curdir(), 'lib', 'sample-tests')
+    : catdir(curdir(), 't', 'sample-tests');
 
 use strict;
 use Test::More;
 
+if ($^O eq 'MacOS') {
+    plan skip_all => "Exit status broken on Mac OS";
+}
+
 my $IsVMS = $^O eq 'VMS';
 
 # VMS uses native, not POSIX, exit codes.
@@ -455,7 +463,7 @@
     }
 
     my $strap = Test::Harness::Straps->new;
-    my %results = $strap->analyze_file("$SAMPLE_TESTS/$test");
+    my %results = $strap->analyze_file(catfile($SAMPLE_TESTS, $test));
 
     is_deeply($results{details}, $expect->{details}, "$test details" );
 

==== //depot/macperl/lib/Test/Harness/t/test-harness.t#9 (text) ====
Index: macperl/lib/Test/Harness/t/test-harness.t
--- macperl/lib/Test/Harness/t/test-harness.t#8~16929~  Fri May 31 09:27:30 2002
+++ macperl/lib/Test/Harness/t/test-harness.t   Fri May 31 13:46:07 2002
@@ -10,7 +10,11 @@
     }
 }
 
-my $SAMPLE_TESTS = $ENV{PERL_CORE} ? "lib/sample-tests" : "t/sample-tests";
+use File::Spec::Functions;
+
+my $SAMPLE_TESTS = $ENV{PERL_CORE}
+    ? catdir(curdir(), 'lib', 'sample-tests')
+    : catdir(curdir(), 't', 'sample-tests');
 
 use strict;
 
@@ -36,9 +40,10 @@
 use Test::More;
 
 my $IsVMS = $^O eq 'VMS';
+my $IsMacOS = $^O eq 'MacOS';
 
 # VMS uses native, not POSIX, exit codes.
-my $die_estat = $IsVMS ? 44 : 1;
+my $die_estat = $IsVMS ? 44 : $IsMacOS ? 0 : 1;
 
 my %samples = (
             simple            => {
@@ -426,7 +431,7 @@
         select NULL;    # _run_all_tests() isn't as quiet as it should be.
         local $SIG{__WARN__} = sub { $warning .= join '', @_; };
         ($totals, $failed) = 
-          Test::Harness::_run_all_tests("$SAMPLE_TESTS/$test");
+          Test::Harness::_run_all_tests(catfile($SAMPLE_TESTS, $test));
     };
     select STDOUT;
 
@@ -444,7 +449,7 @@
         is_deeply( {map { $_=>$totals->{$_} } keys %{$expect->{total}}},
                    $expect->{total},
                                                   "$test - totals" );
-        is_deeply( {map { $_=>$failed->{"$SAMPLE_TESTS/$test"}{$_} }
+        is_deeply( {map { $_=>$failed->{catfile($SAMPLE_TESTS, $test)}{$_} }
                     keys %{$expect->{failed}}},
                    $expect->{failed},
                                                   "$test - failed" );

==== //depot/macperl/lib/lib_pm.PL#3 (text) ====
Index: macperl/lib/lib_pm.PL
--- macperl/lib/lib_pm.PL#2~16926~      Fri May 31 09:07:35 2002
+++ macperl/lib/lib_pm.PL       Fri May 31 13:46:07 2002
@@ -74,7 +74,7 @@
            Carp::carp("Empty compile time value given to use lib");
        }
 
-       $_ = _nativize($_);
+       local $_ = _nativize($_);
 
        if (-e && ! -d _) {
            require Carp;
@@ -109,7 +109,7 @@
 
     my %names;
     foreach (@_) {
-       $_ = _nativize($_);
+       local $_ = _nativize($_);
 
        my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
            = _get_dirs($_);

==== //depot/macperl/t/comp/use.t#2 (xtext) ====
Index: macperl/t/comp/use.t
--- macperl/t/comp/use.t#1~16123~       Tue Apr 23 18:25:17 2002
+++ macperl/t/comp/use.t        Fri May 31 13:46:07 2002
@@ -82,7 +82,7 @@
 }
 print "ok ",$i++,"\n";
 
-print "not " unless $INC[0] eq "fred";
+print "not " unless ($INC[0] eq "fred" || ($^O eq 'MacOS' && $INC[0] eq ":fred:"));
 print "ok ",$i++,"\n";
 
 eval "use lib 1.0 qw(joe)";
@@ -92,7 +92,7 @@
 }
 print "ok ",$i++,"\n";
 
-print "not " unless $INC[0] eq "joe";
+print "not " unless ($INC[0] eq "joe" || ($^O eq 'MacOS' && $INC[0] eq ":joe:"));
 print "ok ",$i++,"\n";
 
 eval "use lib 1.01 qw(freda)";
@@ -101,7 +101,7 @@
 }
 print "ok ",$i++,"\n";
 
-print "not " if $INC[0] eq "freda";
+print "not " if ($INC[0] eq "freda" || ($^O eq 'MacOS' && $INC[0] eq ":freda:"));
 print "ok ",$i++,"\n";
 
 {

==== //depot/macperl/utils/dprofpp.PL#2 (text) ====
Index: macperl/utils/dprofpp.PL
--- macperl/utils/dprofpp.PL#1~16123~   Tue Apr 23 18:25:17 2002
+++ macperl/utils/dprofpp.PL    Fri May 31 13:46:07 2002
@@ -2,6 +2,7 @@
 
 use Config;
 use File::Basename qw(&basename &dirname);
+use File::Spec;
 
 # List explicitly here the variables you want Configure to
 # generate.  Metaconfig only looks for shell variables, so you
@@ -17,7 +18,7 @@
 $file =~ s/\.pl$// if ($Config{'osname'} eq 'OS2');      # "case-forgiving"
 $file =~ s/\.pl$/.com/ if ($Config{'osname'} eq 'VMS');  # "case-forgiving"
 
-my $dprof_pm = '../ext/Devel/DProf/DProf.pm';
+my $dprof_pm = File::Spec->catfile(File::Spec->updir, 'ext', 'Devel', 'DProf', 
+'DProf.pm');
 my $VERSION = 0;
 open( PM, "<$dprof_pm" ) || die "Can't open $dprof_pm: $!";
 while(<PM>){

==== //depot/macperl/utils/splain.PL#2 (text) ====
Index: macperl/utils/splain.PL
--- macperl/utils/splain.PL#1~16123~    Tue Apr 23 18:25:17 2002
+++ macperl/utils/splain.PL     Fri May 31 13:46:07 2002
@@ -2,6 +2,7 @@
 
 use Config;
 use File::Basename qw(&basename &dirname);
+use File::Spec;
 use Cwd;
 
 # List explicitly here the variables you want Configure to
@@ -20,7 +21,7 @@
 $file .= '.com' if $^O eq 'VMS';
 
 # Open input file before creating output file.
-$IN = '../lib/diagnostics.pm';
+$IN = File::Spec->catfile(File::Spec->updir, 'lib', 'diagnostics.pm');
 open IN or die "Can't open $IN: $!\n";
 
 # Create output file.
End of Patch.

Reply via email to