Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

make test when modules in funny locations

by matthewb (Curate)
on May 19, 2006 at 13:11 UTC ( #550487=perlquestion: print w/replies, xml ) Need Help??

matthewb has asked for the wisdom of the Perl Monks concerning the following question:

O wise monks.

I am trying to retrofit a test suite on an existing application the directories of which have been laid out in a nonstandard way. I am unable to change the following conditions:

  1. Directory structure must stay as it is
  2. Have to use ExtUtils::MakeMaker

The difficulty that I am having is in advising make test to look for module files in a location other than blib/lib/

I am aware that I could put a use lib ... line at the top of every test and also that, alternatively I could specify a PM => {} mapping in the Makefile.PL to copy libraries to another location. Both of these solutions seem messy to me and possibly troublesome to maintain in the longer term.

Looking through the docs for ExtUtils::MakeMaker I am interested to note the PMLIBDIRS option that tells it (EUMM) where to look for nonstandard modules. However, when using this solution, make reproduces the whole path under blib/, again stopping make test from doing its thing.

I'm pretty sure I've explored the possibilities available to me but wonder if any of the whizz-kids know of a clean and simple solution to my troubles?

Any advice greatly appreciated,

Update: note that I am not asking how to tell Perl to look in a directory other than those usually found in @INC here,


Replies are listed 'Best First'.
Re: make test when modules in funny locations
by samtregar (Abbot) on May 19, 2006 at 18:07 UTC
    I don't think it makes much sense to use ExtUtils::MakeMaker to run your tests unless you're building a CPAN distribution, which I assume is not the case here. For my custom projects I use a Makefile with a custom rule which runs the test files (usually t/*.t) with Test::Harness.


Re: make test when modules in funny locations
by rinceWind (Monsignor) on May 22, 2006 at 15:55 UTC

    PERL5LIB is your friend. Set this environment variable to a colon delimited list of paths to lib directories, and these will be inserted into @INC for you when perl starts up.


    Oh Lord, wonít you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, wonít you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

      Or you could use HARNESS_PERL_SWITCHES="-Iwhatever -Iwhateverelse" make test as well. PERL5LIB is okay as long as you don't forget to unset it later...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://550487]
Approved by marto
Front-paged by Old_Gray_Bear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2020-09-20 07:28 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (120 votes). Check out past polls.