Michael G Schwern wrote:
On Mon, Sep 19, 2005 at 06:55:12PM -0500, Comrade Burnout wrote:

i upgraded to 5.8.2 (i think that's the minor version number .. don't
recall), and that "magickally" fixed everything.
i was running 5.6.1 at the time.


Oh. Did you chdir() at all in the tests? Earlier versions of MakeMaker used relative paths in @INC for blib/lib. So if your test changes directories
and then tries to load a module it won't find the ones in blib.



BINGO.

(Or, at the very least, B-I-N-G; I'm not sure if that's the *complete* explanation.)

Burnout was helping me beta-test ExtUtils-ModuleMaker. While the code itself is (I think) pre-5.6 compatible, the test suite is designed mainly to run on 5.6+ -- mainly because I make generous use of File::Temp to provide a safe environment in which to test the creation of directories and files. That's important because accurate creation of directories and files is, after all, the point of EU::ModuleMaker.

(Secondary reason for tests needing 5.6: as you, Schwern, pointed out several weeks back, doing without qr// is just too painful!)

And every time I created a temporary directory, I had to chdir to get into it. Since every such chdir succeeded, I never suspected that such a change in directory could cause the test to "forget" about the blib/lib/*.pm files.

The thing that puzzled me about Burnout's test failures was that they seemed to happen at places where the code was very mundane. We've been communicating on this list, Perlmonks, and off-list about it for weeks. We did confirm that the tests were referencing the old, installed version of EU::ModuleMaker, but couldn't figure out why that was so.

But if the problem was not, per se, that Burnout was running 5.6.1, but that he was running an old version of EU::MakeMaker that kept pointing back to the old, installed version of EU::ModuleMaker (keep those names straight!), then a lot becomes explicable. (What follows refers to test failure reports Burnout sent me off-list on Sept 7.)

t/02_bad_constructor..............Odd number of elements in hash assignment at /usr/local/lib/perl5/site_perl/5.6.1/ExtUtils/ModuleMaker.pm line 232.
#     Failed test (t/testlib/Auxiliary.pm at line 163)
#                   ''
# doesn't match '(?-xism:^Must be hash or balanced list of key-value pairs:)' Odd number of elements in hash assignment at /usr/local/lib/perl5/site_perl/5.6.1/ExtUtils/ModuleMaker.pm line 232.

Of course, in the old version of ModuleMaker, the value of AUTHOR was a hash of hashes, i.e., a 2-level hash. In my recent versions, the elements in the inner level have been moved up to the top level; the value of AUTHOR is a string, not a reference.

t/09_miscargs.....................Can't locate object method "dump_keys" via package "ExtUtils::ModuleMaker" (perhaps you forgot to load "ExtUtils::ModuleMaker"?) at t/09_miscargs.t line 178.
# Looks like you planned 225 tests but only ran 66.
# Looks like your test died just after 66.

The old, installed version of EU::ModuleMaker had no dump_keys method -- so of course it couldn't be found.

Once Burnout upgraded, he got a new version of EU::MakeMaker. But we probably could have fixed the problem *simply* by upgrading MakeMaker.

Burnout:  Do you remember which version of EU::MakeMaker you were using?

Schwern: Do you think it's worthwhile accounting for this MakeMaker anachronism in writing test files, i.e., providing an absolute path to every chdir call?

Thanks!

Jim Keenan

Reply via email to