On Fri, Jan 18, 2002 at 04:57:18AM +0100, Andreas J. Koenig wrote:
> perl@14323 fails here:
> 
> lib/ExtUtils/t/hints................FAILED at test 2
> 
> Don't know why test believes there are two tests. Running harness from
> within the t/ directory passes the test.

My bad.  MakeMaker is spitting out stuff to STDOUT and t/TEST isn't
tolerant of such tomfoolery.  I've got it fixed here, lemme just
finish up 5.48_03 and I'll supply a patch.

Meanwhile, here's a cheap hack:

--- lib/ExtUtils/t/hints.t Thu Jan 17 20:39:51 2002
+++ lib/ExtUtils/t/hints.t      Thu Jan 17 23:12:08 2002
@@ -20,6 +20,7 @@
 
 use ExtUtils::MakeMaker;
 my $mm = bless {}, 'ExtUtils::MakeMaker';
+print "# ";  # XXX cheap hack to comment out check_hints babble
 $mm->check_hints;
 is( $mm->{CCFLAGS}, 'basset hounds got long ears' );



> >>>>> On Thu, 17 Jan 2002 20:25:57 -0500, Michael G Schwern <[EMAIL PROTECTED]> said:
> 
>   > +++ lib/ExtUtils/t/hints.t        Thu Jan 17 20:20:42 2002
>   > @@ -0,0 +1,30 @@
>   > +#!/usr/bin/perl -w
>   > +
>   > +BEGIN {
>   > +    if( $ENV{PERL_CORE} ) {
>   > +        chdir 't';
>   > +        @INC = '../lib';
>   > +    }
>   > +}
>   > +chdir 't';
> 
> This looks suspicious, somebody will try to chdir twice and fail once.

That's ok, its only supposed to do it once.  Its my "test that must
work in both the core and CPAN" idiom.

The trick is in the core it has to chdir to 't' *before* loading any
modules, but outside it has to do it after.  This is because of the
relative paths in @INC.  In the core, its all relative to ./t/, but from
CPAN its relative to ./

If you can think of a better (and shorter) way I'm all ears.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Beef Coronary

Reply via email to