in reply to Re^5: Need advice on test output
in thread Need advice on test output

To achieve the perfect test harness, 1) supply a patch to Smart::Comments that allows it to be enabled/disabled via an environment variable, (with the default being OFF). [...]

Don't need a patch for this item. You can use if to achieve this.

use if $ENV{USE_SMART_COMMENTS}, 'Smart::Comments';

Also, you could omit the use Smart::Comments and do -M.

perl -MSmart::Comments script.pl

However, the effect is shallow when using -M. Only the file loaded directly is affected. To test a module, you'd have to execute it as a script.

perl -MSmart::Comments Module.pm

Replies are listed 'Best First'.
Re^7: Need advice on test output
by BrowserUk (Patriarch) on Jan 06, 2007 at 08:07 UTC

    Thanks, I like that.

    I'd still like the ability to switch between a 'Say nothing for passes but stop at the first assert failure' development mode and a 'Report everything, passes and failures, but don't stop' run-a-user-testcase mode; also the ability to adjust the Smartness level; via the command line or environment.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.