Trying to make my CPAN module do all the up-to-date and "correct" stuff, I've learned that some(many) module boilerplates and defaults are not correct. Someone pointed me to this article which mentions things like “running of tests under AUTOMATED_TESTING” with the expectation that the reader knows what he's talking about. There seems to be a community of testers that share war stories and develop Best Practices and invent new modules.

So how does one find that community? I've read the Test Tutorial documents, Test::Simple and Test::More and gleamed some things from the test files generated by module-starter (which I'm told are incorrect). But that's just the tip of the iceberg, it would seem.

Where is the documentation on the details of these environment variables and other settings, how to tools and CPAN uses testing, etc.? Is there a tutorial for not just writing a single test case but in setting up the module correctly?

A more specific question: I got a CPAN tester report back concerning failure on Windows, because I'm testing that a function dies when documented to be exceptional, and furthermore that the Carp is giving information relating to the correct caller (the call of the user-facing API). Since the file names are different on Windows, this detail was wrong. But that's not reason for someone to reject the module if a dependency pulls it in. This talk of "advanced testing" is about module details and POD, but it would seem that some picky details that can be tested are "warning", not "fatal" or part of the critical feature set.

I have "ok" and "not ok". What about "somewhat OK"?

In this particular case, I'd like to know from the CPAN test suite on all versions and platforms that the warning exists, so I don't want to skip the test. But it should not mark the module as being bad on that platform/version.


In reply to How To Test by John M. Dlugosz

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!
  • 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:
    & &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.