There's probably a better approach. When's the last time you were prompted as to whether or not you want to test the module you're about to install? Perhaps not unheard of, but certainly rare. While test dependencies are not rare.

There are other ways to handle it. One solution could be to compose as many tests as practical that don't require this dependency. Then create another group of tests that do require this dependency. Wrap these tests in a SKIP:{...} block, as described in Test::More - Conditional tests.

That way, if the dependency exists, the test will run. If not, you can supply a message about why certain tests are being skipped, and move on.

Of course you do have to decide how important it is for those tests to run. On some of the modules I've been working on recently (Inline related stuff) the tests are critical to assuring that the user will actually be able to use the module. And it's entirely possible for some of my tests to fail on certain systems. You may be in such a situation, or you may be in a situation where the code being tested is pretty reliable and portable -- where a pass on one system is almost certain to equate to a pass on all systems that meet minimum version requirements.

If you're closer to my situation where from one system to the next tests can perform differently, you wouldn't want to skip a critical test. If your module is built on more stable ground, or if the components tested by the dependency are pretty stable, you may be Ok with skipping them.

If you do feel it's important to run the tests on all systems, don't be afraid to pull down a test dependency. It's pretty common to do so.


Dave


In reply to Re^5: How to specify tests dependencies with Makefile.PL? by davido
in thread How to specify tests dependencies with Makefile.PL? by OlegG

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.