develooper Front page | perl.perl5.porters | Postings from April 2010

Re: 5.12.0 test failures in lib/blib.t and lib/locale.t: Darwin/PPC

Thread Previous | Thread Next
From:
James E Keenan
Date:
April 15, 2010 17:54
Subject:
Re: 5.12.0 test failures in lib/blib.t and lib/locale.t: Darwin/PPC
Message ID:
4BC7B559.402@verizon.net
Craig A. Berry wrote:

>
> I think the Darwin version of 8.11.0 means Tiger, right?  I can't
> reproduce these failures on Leopard (also PPC).

Yes:  Mac OS X 10.4.11; PPC/Darwin

I spent several hours this evening looking at this bug.  Here is what I 
have found.

1.  The failure occurs after line 54 of lib/blib.t.

      51 use Test::More tests => 7;
      52
      53 eval 'use blib;';
      54 ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not 
found' );
      55

If I insert an __END__ statement between lines 53 and 54, the file runs 
without error.  If I move that __END__ right after line 54, the 
"insecure dependency" message appears and the file dies.

2.  I can magically make the "insecure dependency" message vanish and 
have the file complete successfully if I insert one or more Test::More 
tests between the 'use Test::More' on line 51 and the "eval 'use blib;'" 
on line 53.  It doesn't matter what the test says (AFAICT so far).  Nor 
does it matter whether the test passes or not.  It just has to be a test.

This, for example, clears the problem up:

      50 use Test::More qw(no_plan); # tests => 7;
      51
      52 is(1,0,"Failing test");
      53 eval 'use blib;';
      54 ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not 
found' );

No "insecure dependency"; no die.

But if the statement I insert is not a test, the "insecure dependency" 
message returns, as does the file death.

      50 use Test::More qw(no_plan); # tests => 7;
      51
      52 #is(1,0,"Failing test");
      53 print STDERR "Goodbye, cruel world\n";
      54 eval 'use blib;';
      55 ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not 
found' );

This generates:

[t] 620 $ ./perl -T ../lib/myblib.t
Goodbye, cruel world
Insecure dependency in require while running with -T switch at 
../lib/Test/Builder.pm line 812.
# Looks like your test exited with 2 before it could output anything.


2.  Apart from the above, I have to wonder whether the message/name for 
the test on line 54 is really correct:

      53 eval 'use blib;';
      54 ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not 
found' );

When I see "eval 'use blib;'", I think to $self:  "This program is 
trying to see if the *pragma* blib.pm is locatable."  I would therefore 
expect a test of any $@ message generated by this eval EXPR to be 
something like this:  "Could not locate blib.pm" -- which is quite 
different from being unable to locate a blib/ *directory*.

True, for later in this test file you want to be able to create a blib/ 
directory and other directories thereunder.  And so, to guarantee the 
validity of those tests, you want to start off by making sure that you 
don't have any blib/ directories at the outset.  But I don't see that 
that has any connection to whether you can 'use blib;'.

Note:  I still don't see why this test fails on this version of Darwin 
but not elsewhere (such as on Debian Linux/i386 (Linode)).

Jim Keenan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About