Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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 Foo.pm class file, there is a corresponding FooTest.pm file which contains a class that derives from Test::Unit::TestCase. Within each subdirectory of the class tree, there is a file called TestSuite.pm which inherits from Test::Unit::TestSuite, and subsumes all of the *Test.pm files from its directory, as well as any TestSuite.pm 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 TestRunner.pl 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

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (10)
    As of 2014-09-18 14:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (116 votes), past polls