Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I am trying to strike a balance between pleasing the Romans whilst in Rome, and organizing the testing framework for a module in a way that I deem sensible for my objectives. Specifically, while h2xs gives you a skeleton that assumes a t/ subdirectory, and a collection of tests t/*.t, I would much prefer to have a tree-like hierarchy of tests. It's not readily apparent to me if there is a good way to do this that doesn't involve an odious amount of hand hacking of the skeleton proffered by h2xs. Consequently I'm wondering what experiences other people have had with this matter.

My module has a collection of class files in a tree structure. Presently, I am using Test::Unit, and for each class file, there is a corresponding file which contains a class that derives from Test::Unit::TestCase. Within each subdirectory of the class tree, there is a file called which inherits from Test::Unit::TestSuite, and subsumes all of the * files from its directory, as well as any files in subdirectories. The result is a tree of test suites which allow you to test any sub-tree of the module in isolation, or to test the whole thing with one command line that employs the script that comes with the Test::Unit module.

Before pushing this module out to CPAN, I would like to move from using Test::Unit to Test::More, since it seems to be the de facto standard for testing, and Test::Unit seems to be ill-maintained. I do not, however, which to squash all of my tests into one directory, poorly mimicking a tree of tests by having really long and cumbersome file names with dashes or what have you.

So, in summary, the question I am posing to my fellow monks is as follows... Is there a good way to use Test::More in a fashion that plays well with Test::Harness whilst employing a battery of tests in a tree structure as opposed to a single flat directory?

In reply to Organizing Module Tests Sensibly by skyknight

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

  • 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, 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, 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (11)
    As of 2015-11-30 16:06 GMT
    Find Nodes?
      Voting Booth?

      What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

      Results (777 votes), past polls