Trouble running test scripts with ExtUtils::MakeMaker

W

wisnij

A few days ago I wrote a Perl module and put it into a directory
structure created with h2xs in order to do unit testing. My very
earliest tests were failing unexpectedly, so I pared the testing
scripts down to the very bare minimum to see if I could find the
problem. There were eventually just two files, t/00foo.t and
t/01bar.t, both with exactly the same two-line content:

use Test::More tests => 1;
BEGIN { use_ok 'My::Module' };

Running "make test" (perl 5.8.7 on Cygwin), this was the output modulo
some line wrapping:

/usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,
'blib/lib', 'blib/arch')" t/*.t
t/00foo....ok
t/01bar....
# Failed test 'use My::Module;'
t/01bar....NOK 1# in t/01bar.t at line 2.
# Tried to use 'My::Module'.
# Error: Can't locate My/Module.pm in @INC (@INC contains:
/usr/lib/perl5/5.8/cygwin [etc...] /usr/lib/perl5/vendor_perl/5.8 .) at
(eval 3) line 2.
# BEGIN failed--compilation aborted at t/01bar.t line 2.
# Looks like you failed 1 test of 1.
t/01bar....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-----------------------------------------------------------------
t/01bar.t 1 256 1 1 100.00% 1
Failed 1/2 test scripts, 50.00% okay. 1/2 subtests failed, 50.00%
okay.
make: *** [test_dynamic] Error 14

How could this possibly happen? I tried it out with more copies of the
same testing file, and the output followed the same pattern: the
scripts would alternate between succeeding and totally failing to find
the module. The only thing I can think of is that I've somehow gotten
a buggy copy of Test::Harness or some other module, and it's failing
pass on the existence of blib/lib and so forth to every other test
script for some reason; it's clearly not in @INC when 01bar.t is run,
even though it certainly should be.

Has anybody ever seen something like this? I've written a few modules
before, but I've never seen anything fail like this.

-- J.
 
S

Sisyphus

<[email protected]>
..
..
the
scripts would alternate between succeeding and totally failing to find
the module. ..
..

Has anybody ever seen something like this? I've written a few modules
before, but I've never seen anything fail like this.

I've seen posts about this on the MakeMaker list a few months back. Not sure
of the details as I don't have cygwin and didn't take much interest in it.
See:
http://www.mail-archive.com/[email protected]/msg02084.html

I think the whole thread is available from that page - otherwise you can
access that thread from:
http://www.mail-archive.com/[email protected]/thrd2.html

Cheers,
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top