[VPM] Solution for the MakeMaker question

Darren Duncan darren at DarrenDuncan.net
Thu Sep 2 22:59:18 CDT 2004


In case anyone was interested in the solution to the question I 
posted on August 30 of subject "MakeMaker question", I have it here.

In order for 'make test' to see a perl module that is being stored 
under the t/ directory in a Perl module distribution, rather than the 
lib/ directory with the main modules, I found that adding a simple 
"use lib 't/';" (or in my case, "use lib 't/lib/';") to the top of 
each of my t/*.t files did the trick.  No change to the Makefile.PL 
necessary.

FYI: My having asked the question to you in the first place was due 
to some mistaken assumptions on my part as to what happens during the 
install process.  For one thing, I had assumed that 'make' would be 
copying the test files to some special location known to it, 
somewhere under blib/, and so I would have no idea for where to make 
a "use lib ..." point to.  Also, I had assumed that "use lib ..." 
only took absolute paths such as "/home/user/foo" (I only saw it used 
that way before) and hence I couldn't use it because I didn't know 
the layout of the end user's system.  Taken together, I thought 
MakeMaker would have to calculate some things.  However, now that I 
know that, 1, "use lib ..." can take relative paths, and 2, the 
current working directory *during* the tests remains the same as 
where you were before starting the install process, everything looks 
much simpler, and my bad assumptions are gone.

So, all's well that end's well.  Thanks to Tim Bunce for pointing me 
in the right direction.

I have now applied the relevant change to all 4 of my distributions 
that used tests-only modules, and the newer distros have been 
uploaded to CPAN over the last few days; users are now saved some 
pollution.

Have a good day. -- Darren Duncan


More information about the Victoria-pm mailing list