All I can do is throw an exception and exit if something is missing, or notify and continue.

What I would do is have the test code check to see if something is missing and then use Test::More's "skip" feature to skip any tests that depend on the feature.

I realize this isn't what you regard as The Right Way, but I think it works tolerably well. I think it would be pretty difficult for the build process to cover every sort of system feature that you might be interested in checking.

(I see that if I have to skip all of the tests, the smoketest machines mail me UNKNOWN messages instead of FAIL... seems reasonable, off hand).

If anyone's interested, I've been writing test code that looks like:

use Test::More; my $emacs_found = qx{ emacs --version 2>/dev/null }; if( not( $emacs_found ) ) { plan skip_all => 'emacs was not found in PATH'; } else { plan tests => 27; } use_ok( 'Emacs::Run' ); [...]

In reply to Re: Testing for non-perl system requirements by doom
in thread Testing for non-perl system requirements by leocharre

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.