Because I'll be gone a couple of days, I wanted to get a quick alpha of the TAP parser out there. It has no docs.
Here's how you use it (or you could look at the tests):
my $parser = TAP::Parser->new; $parser->parse($tap); # croaks on bad TAP print $parser->plan; while ( my $test = $parser->tests ) { print $test->as_string; # or print $test->is_ok; # boolean value print $test->ok; # 'not ok' or 'ok' print $test->number; print $test->description; print $test->directive; # TODO or SKIP data }
You can download it from my Website.
It'd be awfully swell if you can feed it a bunch of TAP output so I can see what if fails on. Kibitzing is also encouraged, though I warn you that the thing was thrown together rather hastily.
Re:cp Test::TAP::Model
Ovid on 2006-07-04T20:50:12
I have no control over the name "TAP", so that part will not change. Also, even though it looks like it belongs under the Test:: namespace, it don't think it does, though I'm not too worried about it. TAP::Parser has nothing to do with tests. All it does is parse the TAP protocol and gives you an OO interface for examining results. If something doesn't parse, it throws an exception with a clear message as to why (though I should probably push errors onto a stack and report all of them at once).
Since it merely parses a protocol and really doesn't know about tests, that's the reason for the namespace. The TAP:: top-level namespace is already established and TAP is widely used outside of the Perl community, so there's no serious way to change the name now.
Re:cp Test::TAP::Model
osfameron on 2006-07-04T21:40:17
Oh, sure, pet peeve aside, I agree that the TAP "brand" is a good idea and should be part of the module name, sorry to overstate the case! It looks like it could become a useful part of a testing infrastructure toolkit.
Searching CPAN for TAP only comes up with TAP.pm though (a documentation-only package describing the protocol) in the top-level namespace. Or am I missing something?
Re:cp Test::TAP::Model
chromatic on 2006-07-04T22:00:25
TAP.pm is much less than a week old, much like the TAP module plan. It'll get there soon enough.