I'm planning, within the next couple of weeks or so, to release a new version of TAPx::Parser. Amongst other things, I have two test harnesses now included with it (one is a subclass of the other which allows test output to be colorized). Along with this, I have a runtests utility, similar to prove. Here's the start of the docs for runtests:

NAME runtests - Run tests through a TAPx harness. USAGE runtests [options] [files or directories] OPTIONS Boolean options -v, --verbose Print all test lines. -l, --lib Add 'lib' to the path for your tests. -b, --blib Add 'blib/lib' to the path for your tests. -s, --shuffle Run the tests in random order. -c, --color Color test output. See TAPx::Harness::Color. -f, --failures Only show failed tests. -m, --merge Merge STDERR and STDOUT -r, --recurse Recursively descend into directories. Options which take arguments -h, --harness Define test harness to use. See TAPx::Harness.

Note that the colored test output and 'show only failures' are two features people have long wanted but are relatively tricky to implement due to the current architecture of Test::Harness. Some of the features I'm planning:

The exec feature might be one of the most important. With that, anything can be tested. For example, imagine the following Perl program we'll call test_html:

#!/usr/bin/perl use Test::HTML::Lint tests => 1; my $file = shift; open my $fh, '<', $file or die "Cannot open ($file) for reading: $!"; my $html = do { local $/; <$fh> }; html_ok( $html, "$file has valid HTML" );

With the above, you could do this:

  runtests --recurse --exec 'test_html %s' www/

Congratulations! You've just converted all of your HTML documents into tests. Or, at least that's the intention :)

What else would you like to see in a new test framework for Perl? People have told me they need XML generated (I can't think of a way to do this generically, though I have the pieces in place to make it easy to write), GUIs, and emailing test failures. What would you like?

Cheers,
Ovid

New address of my CGI Course.


In reply to What do you want your test suite to do? by Ovid

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.