I am trying to setup a test suite in perl, and I was hoping some one can help me with the overall design/setup of a test suite/testharness in perl:
I am using h2xs to generate a template for modules and test scripts, and using Test::More for testharness.
The directory structure generated by h2xs, after some of my modifications is as follows:
$ ls -Ra Perf/
Perf/:
. .. MANIFEST Makefile.PL README lib t
Perf/lib:
. .. Perf.pm
Perf/t:
. .. Controller_perf.t perf1.pl perf2.pl
- I plan to setup different Modules/libs for different test segments e.g. Performance (Perf.pm), Call processing (CP.pm), ...
- Each test segment will have its own set of test cases, so for instance Performance segment will have perf1.pl, perf2.pl ...
- I intend to have a controller script, e.g. controller_perf.t, which will call all the scripts that need to be run in a particular segment. So within controller I have "system" calls to execute the different test scripts, e.g. controller_perf.pm will call:
$test1Result = system('\t\perf1.pl');
$test2Result = system('\t\perf2.pl');
-On doing, make test, all the .t files under /t will get executed, so it will execute the controller.t script only, which in turn will call each of the .pl scripts. I want to have the controller script so I can skip tests, and collect all test results in a single script which will write results to a text file.
- Is this a good way of going about setting up a test suite? Is there something I should be doing differently,
or something can be improved here?
Thanks!
jc
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.