Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The test suite itself is not a module. One of the tests (well, two actually) use a module that inherits from the main module and exists only to test a certain feature of subclassing the main module.

And I generated the whole thing with h2xs, and I deleted test.pl and put several test scripts in a 't' subdirectory as per the docs, and my 'test' module is buried in the 't' directory and gets found via a 'use lib' and statement in the relevant test scripts.

Sorry if I was unclear...

Update:The test scripts don't actually explicitly use the test module themselves, but the module gets use'd from within the main module via arguments in the import list or the constructor method of the main module (and this whole process is what I'm testing), so the test module needs to be a ".pm" file and the path to it needs to get into @INC.

I don't like the way I currently have it with the test scripts themselves renaming the file, so I've lately decided to put 'use lib' statements in the test scripts, and put this after the WriteMakeFile() in Makefile.PL:

find( sub { return unless /^FLTest.pt$/; return if -f "FLTest.pm"; copy("FLTest.pt", "FLTest.pm") or die "Couldn't create FLTest.pm (some tests will fail): $!"; }, ".");

In reply to Re: Re: Including a 'test only' module in distribution by runrig
in thread Including a 'test only' module in distribution by runrig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (None)
    As of 2024-04-25 00:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found