Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
One of the features I'm working on for TAPx::Parser is the ability to test anything. Admittedly, this is a big attempt, but here's what I'm thinking. Imagine the following program:
#!/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" );
Now that looks weird. Why would I want arguments to a test script? Well, name it test_html and you can do this ('extension' is deliberately misnamed):
runtests --recurse --exec 'test_hml %s' --xtension 'html?' www/
You've now turned all HTML files in your www/ directory into tests!
--exec is expected to take a sprintf format which will be opened with this:
my $fh = gensym;
my $command = sprintf $exec, $arg;
if ( open $fh, "$command |" ) {
return TAPx::Parser::Iterator->new($fh);
}
else {
...
}
So long as whatever you pass into --exec outputs TAP, you can test anything you want. In fact, it doesn't even have to be filenames. You could pass a list of urls to runtests and have your testing utility fetch them and run tests on them.
What I'm trying to figure out is how to easily handle a test suite with test programs written in Perl, C, etc. My current plans only allow one type of --exec at a time. Thoughts?
Update: I might just make the %s optional in the format and tack it on to the end if it's not in the string. I'd also disallow any other % sign in the format since that would screw up the sprintf.
Beware of strange characters... (Score:1)
You might not want to use
sprintfand the string form of pipeopen. Think what happens when you get a file name containing spaces, or asterisks, or pipe characters, or anything else that's special to the shell (yes, I actually had such names: one of my applications used TT2 to generate documents, and the file names themselves were expanded by TT2, so I had names like[% customer.name | filename %] - [% orders.last_number | format('%04d') %].txt)I'd suggest doing what
find'sexecoption does: gobble up alURLs? (Score:1)
Does this thing have URI support yet?
Can I say "Go test that URL that will spit you back TAP" and have it work?
Re: (Score:2)
This feature is not yet ready but I'm already getting email asking for it so I need to see if I can get this out the door by this weekend at the latest. My biggest obstacle, actually, isn't getting this feature to work (it's fairly simple), but getting TAPx::Harness output as similar as possible to Test::Harness output. I don't want to suprise users too much by making the output radically different, but I also have so much more information I can present, if they users want it (such as which tests unexpect