I'm revisiting this year-old question because I had occasion last week to try to do this benchmark-plus-test thing in an extensible way and came up against some funny roadblocks. The most amusing/irritating was that overriding
sub ok turned out to be a total bust! So I'll comment for posterity (which will include my future self) about why.
Quite simply, ok just reads the result of the test. So in ok(&test1, 'the first test') ; the ok method doesn't get invoked at all until test1 has finished. Hence, all my tests were showing up as instantaneous (because I was really just measuring time it took to call the ok method itself). What I need, somehow, is a version of "ok" that takes a subroutine as its first argument rather than a string then times the execution.
As part of the process, though, I came across Test::More::Diagnostic which seems like the right kind of idea for augmenting my outputs so that future executions can be compared to baseline. This seems like a version of "write your own harness," and I'm hoping it won't be all that difficult.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.