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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What do you want your test suite to do?
by jettero (Monsignor) on Jan 02, 2007 at 12:12 UTC | |
by Ovid (Cardinal) on Jan 02, 2007 at 12:25 UTC | |
|
Re: What do you want your test suite to do?
by Anonymous Monk on Jan 02, 2007 at 11:32 UTC | |
by Ovid (Cardinal) on Jan 02, 2007 at 11:51 UTC |