Thanks for the response.

I've been experimenting with this and have minimized my test code to the following:

use Test::More tests => 1; SKIP: { eval{ require Data::Dummy }; skip "Data::Dummy not installed", 2 if $@; ok( 1 ); }
This works fine when the required module is present, but in the case of a non-existant module (such as with the above Data::Dummy), the following is reported:
C:\>nmake test Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harn +ess(0, 'blib\lib', 'blib\arch')" t\test.t t\test....# Looks like you planned 1 tests but ran 1 extra. t\test....dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test Failed 0/1 tests, 100.00% okay (less 2 skipped tests: -1 okay, + -100.00%) Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t\test.t 1 256 1 0 0.00% 2 subtests skipped. Failed 1/1 test scripts, 0.00% okay. -1/1 subtests failed, 200.00% oka +y. NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code + '0x2' Stop.
I don't understand why this would complain of skipping two subtests, nor why it says that I planned 1 test but ran 1 extra. Is this what normally happens when tests are skipped?

In reply to Re: Re: Optional modules for tests? by sutch
in thread Optional modules for tests? by sutch

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.