Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Proper location of module required for test scripts

by gflewis (Initiate)
on May 03, 2015 at 14:10 UTC ( [id://1125511]=perlquestion: print w/replies, xml ) Need Help??

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

I am trying to package my first module for CPAN distribution. It is pretty simple: just a single module; but there are about 20 test scripts. I am using Module::Build. I have a small file ("test.config") of configuration data that is required for most of my test scripts, and a small module ("TestUtil.pm") that reads this configuration data. Currently these two files are in the "t" directory. However, when I type ./Build test it can't locate TestUtil.pm. What is the proper location for a module whose only purpose is to support the test scripts?

Replies are listed 'Best First'.
Re: Proper location of module required for test scripts
by Corion (Patriarch) on May 03, 2015 at 14:34 UTC

    I usually load such modules by having this line near the top of every test file:

    use lib 't';
      Perfect. Thanks for the quick reply.
Re: Proper location of module required for test scripts
by Your Mother (Archbishop) on May 03, 2015 at 16:28 UTC

    FWIW, Module::Build is being phased out (of the core). And I, for one, welcome our new insect overlords: Module::Install. Module::Build based CPAN modules were the only ones I ever had trouble with and I never understood how so many smart monks and Perl hackers could keep recommending it as The Way™.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1125511]
Approved by hdb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found