Syncing with bleadperl
authorMichael G. Schwern <schwern@pobox.com>
Fri, 18 Jan 2002 03:04:33 +0000 (22:04 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 18 Jan 2002 14:30:49 +0000 (14:30 +0000)
Message-ID: <20020118080432.GC7226@blackrider>

p4raw-id: //depot/perl@14325

27 files changed:
MANIFEST
lib/ExtUtils/Changes [new file with mode: 0644]
lib/ExtUtils/Embed.pm
lib/ExtUtils/Liblist.pm
lib/ExtUtils/MM_Win32.pm
lib/ExtUtils/MakeMaker.pm
lib/ExtUtils/Manifest.pm
lib/ExtUtils/Mkbootstrap.pm
lib/ExtUtils/Mksymlists.pm
lib/ExtUtils/instmodsh [moved from lib/ExtUtils/inst with 100% similarity, mode: 0644]
lib/ExtUtils/t/Command.t
lib/ExtUtils/t/Embed.t
lib/ExtUtils/t/ExtUtils.t
lib/ExtUtils/t/Installed.t
lib/ExtUtils/t/MM_BeOS.t
lib/ExtUtils/t/MM_Cygwin.t
lib/ExtUtils/t/MM_OS2.t
lib/ExtUtils/t/MM_Unix.t
lib/ExtUtils/t/MM_VMS.t
lib/ExtUtils/t/MM_Win32.t
lib/ExtUtils/t/Manifest.t
lib/ExtUtils/t/Mkbootstrap.t
lib/ExtUtils/t/Packlist.t
lib/ExtUtils/t/hints.t
lib/ExtUtils/t/testlib.t
lib/ExtUtils/testlib.pm
t/lib/TieOut.pm [new file with mode: 0644]

index 1f7078d..68a0e5f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -931,10 +931,11 @@ lib/exceptions.pl         catch and throw routines
 lib/Exporter.pm                        Exporter base class
 lib/Exporter.t                 See if Exporter works
 lib/Exporter/Heavy.pm          Complicated routines for Exporter
+lib/ExtUtils/Changes            MakeMaker change log
 lib/ExtUtils/Command.pm                Utilities for Make on non-UNIX platforms
 lib/ExtUtils/Constant.pm       generate XS code to import C header constants
 lib/ExtUtils/Embed.pm          Utilities for embedding Perl in C programs
-lib/ExtUtils/inst              Give information about installed extensions
+lib/ExtUtils/instmodsh         Give information about installed extensions
 lib/ExtUtils/Install.pm                Handles 'make install' on extensions
 lib/ExtUtils/Installed.pm      Information on installed extensions
 lib/ExtUtils/Liblist.pm                Locates libraries
@@ -2154,6 +2155,7 @@ t/lib/Test/Simple/sample_tests/require.plx              for exit.t
 t/lib/Test/Simple/sample_tests/success.plx              for exit.t
 t/lib/Test/Simple/sample_tests/too_few.plx              for exit.t
 t/lib/Test/Simple/sample_tests/two_fail.plx             for exit.t
+t/lib/TieOut.pm                 Testing library to capture prints
 t/lib/warnings/1global         Tests of global warnings for warnings.t
 t/lib/warnings/2use            Tests for "use warnings" for warnings.t
 t/lib/warnings/3both           Tests for interaction of $^W and "use warnings"
diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes
new file mode 100644 (file)
index 0000000..8aee23c
--- /dev/null
@@ -0,0 +1,22 @@
+5.48_03 Thu Jan 17 23:44:38 EST 2002
+    * moved bin/inst to bin/instmodsh
+    * Some Win32 backporting fixes.  The -x switch doesn't seem to
+      work on Win32/5.6.1.
+    * Bug on Win32.  MAKEMAKER variable not set properly.
+    * _02 broke hints files.  Now fixed.
+    - Minor prereq error formatting glitch
+    - ExtUtils::testlib no longer a thin wrapper around blib, now a 
+      thin wrapper around lib like it was.  blib is noisy on 5.6.1.
+    - Nick and chromatic found and fixed some warnings in the tests
+
+5.48_02 Wed Jan 16 19:11:26 EST 2002
+    - Fixed some Win32 warnings.  Needs more work.
+
+5.48_01 Wed Jan 16 15:10:28 EST 200
+    * Adapted from bleadperl@14303
+    * Backported to 5.6.1
+    - inst and xsubpp moved out of lib/ and into bin/
+    - ExtUtils::testlib obsoleted.  Now a thin wrapper around blib.pm
+    ***--> Non-Unix platforms not tested at all!  Please test and report
+           back.  Tests probably only need minor fixes.
+
index 8643d98..1aae288 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Embed.pm,v 1.2501 $
+# $Id: Embed.pm,v 1.1.1.1 2002/01/16 19:27:19 schwern Exp $
 require 5.002;
 
 package ExtUtils::Embed;
@@ -18,7 +18,7 @@ use vars qw(@ISA @EXPORT $VERSION
            );
 use strict;
 
-$VERSION = sprintf("%d.%02d", q$Revision: 1.2506_00 $ =~ /(\d+)\.(\d+)/);
+$VERSION = 1.2506_01;
 
 @ISA = qw(Exporter);
 @EXPORT = qw(&xsinit &ldopts 
index c7c6f77..b627867 100644 (file)
@@ -24,7 +24,7 @@ package ExtUtils::Liblist::Kid;
 use 5.006_001;
 # Broken out of MakeMaker from version 4.11
 
-our $VERSION = substr q$Revision: 1.27 $, 10;
+our $VERSION = 1.27_01;
 
 use Config;
 use Cwd 'cwd';
index 4784249..76e1bd1 100644 (file)
@@ -1,6 +1,6 @@
 package ExtUtils::MM_Win32;
 
-our $VERSION = '1.00';
+our $VERSION = '1.00_02';
 
 =head1 NAME
 
@@ -144,6 +144,8 @@ sub file_name_is_absolute {
 
 sub find_perl {
     my($self, $ver, $names, $dirs, $trace) = @_;
+    $trace ||= 0;
+
     my($name, $dir);
     if ($trace >= 2){
        print "Looking for perl $ver by these names:
@@ -263,7 +265,7 @@ XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
 };
 
     push @m, qq{
-MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
+MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}
 MM_VERSION = $ExtUtils::MakeMaker::VERSION
 };
 
@@ -322,10 +324,10 @@ makemakerdflt: all
 
 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
 
-# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
-# some make implementations will delete the Makefile when we rebuild it. Because
-# we call false(1) when we rebuild it. So make(1) is not completely wrong when it
-# does so. Our milage may vary.
+# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to 
+# recall, that some make implementations will delete the Makefile when we 
+# rebuild it. Because we call false(1) when we rebuild it. So make(1) is 
+# not completely wrong when it does so. Our milage may vary.
 # .PRECIOUS: Makefile    # seems to be not necessary anymore
 
 .PHONY: all config static dynamic test linkext manifest
index 1f414af..92a46a8 100644 (file)
@@ -2,10 +2,10 @@ BEGIN {require 5.002;} # MakeMaker 5.17 was the last MakeMaker that was compatib
 
 package ExtUtils::MakeMaker;
 
-$VERSION = "5.48";
+$VERSION = "5.48_03";
 $Version_OK = "5.17";  # Makefiles older than $Version_OK will die
                        # (Will be checked from MakeMaker version 4.13 onwards)
-($Revision = substr(q$Revision: 1.222 $, 10)) =~ s/\s+$//;
+($Revision = substr(q$Revision: 1.4 $, 10)) =~ s/\s+$//;
 
 
 
@@ -349,7 +349,7 @@ sub ExtUtils::MakeMaker::new {
            warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found.\n" unless $self->{PREREQ_FATAL};
            $unsatisfied{$prereq} = 'not installed';
        } elsif ($prereq->VERSION < $self->{PREREQ_PM}->{$prereq} ){
-           warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found. We have"
+           warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found. We have "
                . ($prereq->VERSION || 'unknown version') unless $self->{PREREQ_FATAL};
            $unsatisfied{$prereq} = $self->{PREREQ_PM}->{$prereq} ? $self->{PREREQ_PM}->{$prereq} : 'unknown version' ;
        }
@@ -681,14 +681,14 @@ sub check_hints {
     return unless -f $hint_file;    # really there
 
     # execute the hintsfile:
-    print STDOUT "Processing hints file $hint_file\n";
+    print STDERR "Processing hints file $hint_file\n";
     {
         local *HINT;
         open(HINT, $hint_file) || die "Can't open $hint_file: $!";
         eval join '', <HINT>;
         close HINT;
     }
-    print STDOUT $@ if $@;
+    print STDERR $@ if $@;
 }
 
 sub mv_all_methods {
@@ -1857,7 +1857,7 @@ MakeMaker object. The following lines will be parsed o.k.:
 
     $VERSION = '1.00';
     *VERSION = \'1.01';
-    ( $VERSION ) = '$Revision: 1.222 $ ' =~ /\$Revision:\s+([^\s]+)/;
+    ( $VERSION ) = '$Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
     $FOO::VERSION = '1.10';
     *FOO::VERSION = \'1.11';
     our $VERSION = 1.2.3;      # new for perl5.6.0 
index 8066579..eee57d2 100644 (file)
@@ -12,7 +12,7 @@ our ($VERSION,@ISA,@EXPORT_OK,
            $Is_MacOS,$Is_VMS,
            $Debug,$Verbose,$Quiet,$MANIFEST,$found,$DEFAULT_MSKIP);
 
-$VERSION = substr(q$Revision: 1.35 $, 10);
+$VERSION = 1.35_00;
 @ISA=('Exporter');
 @EXPORT_OK = ('mkmanifest', 'manicheck', 'fullcheck', 'filecheck', 
              'skipcheck', 'maniread', 'manicopy');
index 323c3ab..45713c3 100644 (file)
@@ -1,7 +1,6 @@
 package ExtUtils::Mkbootstrap;
 
-$VERSION = substr q$Revision: 1.14 $, 10;
-# $Date: 1996/09/03 17:04:43 $
+$VERSION = 1.14_01;
 
 use Config;
 use Exporter;
@@ -75,7 +74,7 @@ ExtUtils::Mkbootstrap - make a bootstrap file for use by DynaLoader
 
 =head1 SYNOPSIS
 
-C<mkbootstrap>
+C<Mkbootstrap>
 
 =head1 DESCRIPTION
 
index 0135cda..1b88b3e 100644 (file)
@@ -10,7 +10,7 @@ use Config;
 our(@ISA, @EXPORT, $VERSION);
 @ISA = 'Exporter';
 @EXPORT = '&Mksymlists';
-$VERSION = substr q$Revision: 1.18 $, 10;
+$VERSION = 1.18_00;
 
 sub Mksymlists {
     my(%spec) = @_;
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from lib/ExtUtils/inst
rename to lib/ExtUtils/instmodsh
index 3ff59b9..a21661f 100644 (file)
@@ -1,9 +1,15 @@
-#!./perl -Tw
+#!/usr/bin/perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib/');
+    }
+    else {
+        unshift @INC, 't/lib/';
+    }
 }
+chdir 't';
 
 BEGIN {
        1 while unlink 'ecmdfile';
@@ -18,9 +24,8 @@ BEGIN {
 }
 
 {
-       use vars qw( *CORE::GLOBAL::exit );
-
        # bad neighbor, but test_f() uses exit()
+    *CORE::GLOBAL::exit = '';   # quiet 'only once' warning.
        *CORE::GLOBAL::exit = sub { return @_ };
 
        use_ok( 'ExtUtils::Command' );
@@ -51,6 +56,7 @@ BEGIN {
 
        # concatenate this file with itself
        # be extra careful the regex doesn't match itself
+    use TieOut;
        my $out = tie *STDOUT, 'TieOut';
        my $self = $0;
        unless (-f $self) {
@@ -149,13 +155,3 @@ END {
        1 while unlink 'ecmdfile';
        File::Path::rmtree( 'ecmddir' );
 }
-
-package TieOut;
-
-sub TIEHANDLE {
-       bless( \(my $text), $_[0] );
-}
-
-sub PRINT {
-       ${ $_[0] } .= join($/, @_);
-}
index 57ad8d1..bf2d3e7 100644 (file)
@@ -1,9 +1,13 @@
-#!./perl
+#!/usr/bin/perl
 
 BEGIN {
-    chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
+
 use Config;
 use ExtUtils::Embed;
 use File::Spec;
index 24d85d3..e63d117 100644 (file)
@@ -1,10 +1,12 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 print "1..27\n";
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
 
 # use warnings;
@@ -23,7 +25,7 @@ $perl = rel2abs( $^X ) unless $] < 5.006; # Hack. Until 5.00503 has rel2abs
 $^X = $perl;
 
 print "# perl=$perl\n";
-my $runperl = "$perl -x \"-I../../lib\"";
+my $runperl = "$perl \"-I../../lib\"";
 
 $| = 1;
 
@@ -447,15 +449,32 @@ if ($?) {
   print "not ok $test # $maketest failed: $?\n";
   print "# $_" foreach @makeout;
 } else {
-  print "ok $test\n";
+  print "ok $test - maketest\n";
 }
 $test++;
 
-my $regen = `$runperl $package.xs`;
+
+# -x is busted on Win32 < 5.6.1, so we emulate it.
+my $regen;
+if( $^O eq 'MSWin32' && $] <= 5.006001 ) {
+    open(REGENTMP, ">regentmp") or die $!;
+    open(XS, "$package.xs")     or die $!;
+    my $saw_shebang;
+    while(<XS>) {
+        $saw_shebang++ if /^#!.*/i ;
+        print REGENTMP $_ if $saw_shebang;
+    }
+    close XS;  close REGENTMP;
+    $regen = `$runperl regentmp`;
+    unlink 'regentmp';
+}
+else {
+    $regen = `$runperl -x $package.xs`;
+}
 if ($?) {
-  print "not ok $test # $runperl $package.xs failed: $?\n";
+  print "not ok $test # $runperl -x $package.xs failed: $?\n";
 } else {
-  print "ok $test\n";
+  print "ok $test - regen\n";
 }
 $test++;
 
@@ -463,9 +482,9 @@ my $expect = $constant_types . $C_constant .
   "\n#### XS Section:\n" . $XS_constant;
 
 if ($expect eq $regen) {
-  print "ok $test\n";
+  print "ok $test - regen worked\n";
 } else {
-  print "not ok $test\n";
+  print "not ok $test - regen worked\n";
   # open FOO, ">expect"; print FOO $expect;
   # open FOO, ">regen"; print FOO $regen; close FOO;
 }
index ca3e9af..17913ec 100644 (file)
@@ -1,4 +1,13 @@
-#!./perl
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
+}
+chdir 't';
+
 
 use strict;
 use warnings;
@@ -13,14 +22,9 @@ use File::Path;
 # for directories() tests
 use File::Basename;
 
-BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
-}
-
 use Test::More tests => 43;
 
-use_ok( 'ExtUtils::Installed' );
+BEGIN { use_ok( 'ExtUtils::Installed' ) }
 
 # saves having to qualify package name for class methods
 my $ei = bless( {}, 'ExtUtils::Installed' );
@@ -56,7 +60,15 @@ is( $ei->_is_under('foo', @under), 0, '... should find no file not under dirs');
 is( $ei->_is_under('baz', @under), 1, '... should find file under dir' );
 
 # new
-my $realei = ExtUtils::Installed->new();
+my $realei;
+{
+    # We're going to get warnings about not being able to find install
+    # directories if we're not installed.
+    local $SIG{__WARN__} = sub {
+        warn @_ unless $ENV{PERL_CORE} && $_[0] =~ /^Can't stat/;
+    };
+    $realei = ExtUtils::Installed->new();
+}
 
 isa_ok( $realei, 'ExtUtils::Installed' );
 isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );
index 4b8ecc4..6fea269 100644 (file)
@@ -1,13 +1,12 @@
-#!perl
-
-# 2001-01-14 Tels v0.01
-
-our $VERSION = 0.01;
+#!/usr/bin/perl
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 
index eabb608..08b6246 100644 (file)
@@ -1,9 +1,12 @@
-#!./perl
+#!/usr/bin/perl
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 
index f80b0fb..ad7d4b5 100644 (file)
@@ -1,11 +1,14 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 use strict;
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 if ($^O =~ /os2/i) {
index fec24ca..29b5b0a 100644 (file)
@@ -1,14 +1,12 @@
-#!./perl -w
-
-# 2001-12-16 Tels first version
-# 2002-01-13 Tels 0.02 added some tests for various functions, added Andreas
-#                     fix to the version test (>= vs ==)
-# 2002-01-14 Tels 0.03 exclude on beos and netware, /i for $^O test
+#!/usr/bin/perl -w
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 BEGIN { 
     use Test::More; 
@@ -182,7 +180,8 @@ is ($t->nicetext('LOTR'),'LOTR','nicetext');
 ###############################################################################
 # parse_version
 
-my $self_name = '../lib/ExtUtils/t/MM_Unix.t';
+my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t' 
+                                : 'MM_Unix.t';
 
 is ($t->parse_version($self_name),'0.02',
   'parse_version on ourself');
index 784008a..7768e8d 100644 (file)
@@ -1,9 +1,12 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 BEGIN {
     use Test::More;
index 846cca2..4dd697b 100644 (file)
@@ -1,9 +1,12 @@
-#!perl
+#!/usr/bin/perl
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 
@@ -18,23 +21,14 @@ BEGIN {
 use Config;
 use File::Spec;
 use File::Basename;
-
-# Does this mimic ExtUtils::MakeMaker ok?
-{
-    @MM::ISA = qw(
-        ExtUtils::MM_Unix 
-        ExtUtils::Liblist::Kid 
-        ExtUtils::MakeMaker
-    );
-    # MM package faked up by messy MI entanglement
-    package MM;
-    sub DESTROY {}
-}
+use ExtUtils::MakeMaker;
 
 require_ok( 'ExtUtils::MM_Win32' );
 
 # test import of $Verbose and &neatvalue
 can_ok( 'MM', 'neatvalue' );
+() = $ExtUtils::MM_Win32::Verbose;
+() = $ExtUtils::MakeMaker::Verbose;
 is( $ExtUtils::MM_Win32::Verbose, $ExtUtils::MakeMaker::Verbose, 
        'ExtUtils::MM_Win32 should import $Verbose from ExtUtils::MakeMaker' );
 
@@ -126,12 +120,19 @@ SKIP: {
         VERSION_FROM => 'TestMM_Win32',
         PM           => { 'MM_Win32.pm' => 1 },
     }, 'MM';
+
+    # XXX Hack until we have a proper init method.
+    # Flesh out some necessary keys in the MM object.
+    foreach my $key (qw(XS C O_FILES H HTMLLIBPODS HTMLSCRIPTPODS
+                        MAN1PODS MAN3PODS PARENT_NAME)) {
+        $mm_w32{$key} = '';
+    }
     my $s_PM = join( " \\\n\t", sort keys %{$mm_w32->{PM}} );
     my $k_PM = join( " \\\n\t", %{$mm_w32->{PM}} );
 
     like( $mm_w32->constants(),
           qr/^NAME\ =\ TestMM_Win32\s+VERSION\ =\ 1\.00.+
-             MAKEMAKER\ =\ $INC{'ExtUtils\MakeMaker.pm'}\s+
+             MAKEMAKER\ =\ $INC{'ExtUtils/MakeMaker.pm'}\s+
              MM_VERSION\ =\ $ExtUtils::MakeMaker::VERSION.+
              VERSION_FROM\ =\ TestMM_Win32.+
              TO_INST_PM\ =\ \Q$s_PM\E\s+
index 04c57ea..a0e84e0 100644 (file)
@@ -1,9 +1,12 @@
-#!./perl 
+#!/usr/bin/perl 
 
 BEGIN {
-    chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        unshift @INC, '../lib';
+    }
 }
+chdir 't';
 
 # these files help the test run
 use Test::More tests => 31;
@@ -41,8 +44,8 @@ sub remove_dir {
 }
 
 # use module, import functions
-use_ok( 'ExtUtils::Manifest', 
-       qw( mkmanifest manicheck filecheck fullcheck maniread manicopy) );
+BEGIN { use_ok( 'ExtUtils::Manifest', 
+        qw( mkmanifest manicheck filecheck fullcheck maniread manicopy) ); }
 
 my $cwd = Cwd::getcwd();
 
@@ -78,8 +81,7 @@ like( $warn, qr/^Not in MANIFEST: bar/, 'warning that bar has been added' );
 is( $res, 'bar', 'bar reported as new' );
 
 # now quiet the warning that bar was added and test again
-use vars qw($ExtUtils::Manifest::Quiet);
-$ExtUtils::Manifest::Quiet = 1;
+{ package ExtUtils::Manifest;  use vars qw($Quiet); $Quiet = 1; }
 ($res, $warn) = catch_warning( \&ExtUtils::Manifest::skipcheck );
 cmp_ok( $warn, ,'eq', '', 'disabled warnings' );
 
@@ -135,8 +137,10 @@ like( $@, qr/^Can't read none: /,
                                                'carped about none' );
 
 # tell ExtUtils::Manifest to use a different file
-use vars qw($ExtUtils::Manifest::MANIFEST);
-$ExtUtils::Manifest::MANIFEST = 'albatross';
+{ package ExtUtils::Manifest; 
+  use vars qw($MANIFEST); 
+  $MANIFEST = 'albatross'; 
+}
 
 ($res, $warn) = catch_warning( \&mkmanifest );
 like( $warn, qr/Added to albatross: /, 'using a new manifest file' );
index bbb689a..43de3b2 100644 (file)
@@ -1,14 +1,20 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib/');
+    }
+    else {
+        unshift @INC, 't/lib/';
+    }
 }
+chdir 't';
 
 use vars qw( $required );
 use Test::More tests => 18;
 
-use_ok( 'ExtUtils::Mkbootstrap' );
+BEGIN { use_ok( 'ExtUtils::Mkbootstrap' ) }
 
 # Mkbootstrap makes a backup copy of "$_[0].bs" if it exists and is non-zero
 my $file_is_ready;
@@ -38,7 +44,7 @@ SKIP: {
 Mkbootstrap('fakeboot');
 ok( !( -f 'fakeboot.bso' ), 'Mkbootstrap should not backup an empty file' );
 
-
+use TieOut;
 my $out = tie *STDOUT, 'TieOut';
 
 # with $Verbose set, it should print status messages about libraries
@@ -118,8 +124,7 @@ SKIP: {
        close OUT;
 
        # if $DynaLoader::bscode is set, write its contents to the file
-       # localize the variable to prevent "used only once"
-       local $DynaLoader::bscode;
+    local $DynaLoader::bscode;
        $DynaLoader::bscode = 'Wall';
        $ExtUtils::Mkbootstrap::Verbose = 0;
        
@@ -148,19 +153,3 @@ END {
        # clean things up, even on VMS
        1 while unlink(qw( mkboot.bso boot_BS dasboot.bs .bs ));
 }
-
-package TieOut;
-
-sub TIEHANDLE {
-       bless( \(my $scalar), $_[0]);
-}
-
-sub PRINT {
-       my $self = shift;
-       $$self .= join('', @_);
-}
-
-sub read {
-       my $self = shift;
-       return substr($$self, 0, length($$self), '');
-}
index 3e455b7..db8ed59 100644 (file)
@@ -1,9 +1,12 @@
-#!./perl
+#!/usr/bin/perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More tests => 34;
 
@@ -33,7 +36,8 @@ is( ExtUtils::Packlist::FETCH($pl, 'foo'), 'bar', 'check FETCH()' );
 # test FIRSTKEY and NEXTKEY
 SKIP: {
        $pl->{data}{bar} = 'baz';
-       skip('not enough keys to test FIRSTKEY', 2) unless %{ $pl->{data} } > 2;
+       skip('not enough keys to test FIRSTKEY', 2) 
+      unless keys %{ $pl->{data} } > 2;
 
        # get the first and second key
        my ($first, $second) = keys %{ $pl->{data} };
index 7038de9..391b9f7 100644 (file)
@@ -3,25 +3,34 @@
 BEGIN {
     if( $ENV{PERL_CORE} ) {
         chdir 't';
-        @INC = '../lib';
+        @INC = ('../lib', 'lib/');
+    }
+    else {
+        unshift @INC, 't/lib/';
     }
 }
 chdir 't';
 
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 mkdir 'hints';
-my $hint = $^O;
-open(HINT, ">hints/$hint.pl") || die "Can't write dummy hints file: $!";
+my $hint_file = "hints/$^O.pl";
+open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
 print HINT <<'CLOO';
 $self->{CCFLAGS} = 'basset hounds got long ears';
 CLOO
 close HINT;
 
+use TieOut;
 use ExtUtils::MakeMaker;
+
+my $out = tie *STDERR, 'TieOut';
 my $mm = bless {}, 'ExtUtils::MakeMaker';
 $mm->check_hints;
 is( $mm->{CCFLAGS}, 'basset hounds got long ears' );
+is( $out->read, "Processing hints file $hint_file\n" );
+
+package Catch;
 
 
 END {
index e0ef990..8c1ae11 100644 (file)
@@ -1,13 +1,25 @@
-#!./perl 
+#!/usr/bin/perl -w
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More tests => 3;
 
-my @blib_paths = grep { /blib/ } @INC;
+BEGIN { 
+    # non-core tests will have blib in their path.  We remove it
+    # and just use the one in lib/.
+    unless( $ENV{PERL_CORE} ) {
+        @INC = grep !/blib/, @INC;
+        unshift @INC, '../lib';
+    }
+}
+
+my @blib_paths = grep /blib/, @INC;
 is( @blib_paths, 0, 'No blib dirs yet in @INC' );
 
 use_ok( 'ExtUtils::testlib' );
index d80f2a2..93edfd3 100644 (file)
@@ -1,6 +1,5 @@
 package ExtUtils::testlib;
-$VERSION = substr q$Revision: 1.11 $, 10;
-# $Id: testlib.pm,v 1.11 1996/05/31 08:27:07 k Exp $
+$VERSION = 1.12_01;
 
 use lib qw(blib/arch blib/lib);
 1;
@@ -12,10 +11,12 @@ ExtUtils::testlib - add blib/* directories to @INC
 
 =head1 SYNOPSIS
 
-C<use ExtUtils::testlib;>
+  use ExtUtils::testlib;
 
 =head1 DESCRIPTION
 
+B<THIS MODULE IS OBSOLETE!>  Use blib instead.
+
 After an extension has been built and before it is installed it may be
 desirable to test it bypassing C<make test>. By adding
 
diff --git a/t/lib/TieOut.pm b/t/lib/TieOut.pm
new file mode 100644 (file)
index 0000000..0da80cb
--- /dev/null
@@ -0,0 +1,17 @@
+package TieOut;
+
+sub TIEHANDLE {
+       bless( \(my $scalar), $_[0]);
+}
+
+sub PRINT {
+       my $self = shift;
+       $$self .= join('', @_);
+}
+
+sub read {
+       my $self = shift;
+       return substr($$self, 0, length($$self), '');
+}
+
+1;