I am using
Test::Class to do my unit tests for a large distribution that I'm beginning. I really like Test::Class as I can neatly package stuff up in inherritable methods instead of writing long, spaghetti-esque procedural test scripts which offend my sense of style. (Just ask
perrin <grin>).
The docs for Test::Class suggest putting your test modules under t/lib. I understand that this will prevent them from being indexed by PAUSE, which is good. My concern arises over including this directory in my test script, t/main.t, which looks like this:
#!/usr/bin/perl
# t/main.t -- launch all tests from here
use strict;
use warnings;
use lib './t/lib';
use Test::Class;
use MyApp::Test;
use MyApp::Foobar::Test;
Test::Class->runtests;
This works fine on my system, but I'm worried that the use lib might break on other OSes, especially with the hardcoded relative path. Is there an accepted standard way of doing this which is better?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.