TAPx::Parser

Ovid on 2006-07-18T09:34:36

Just to let people know that I haven't completely flaked on the TAP parser, you can download the latest version from my web site. The documentation for this version is minimal and is mostly present in the tests.

As of July 18, 2006, here's the current roadmap:

DONE

  • 'Bail out!' is now handled.
  • The parser is now data driven, thus skipping a huge if/else chain
  • We now track all TODOs, SKIPs, passes and fails by test number (Test::Harness currently cannot do this)
  • Removed all non-core modules.
  • Store original line for each TAP line. Available through $result->raw().
  • Renamed test is_ok() to passed() and added actual_passed(). The former method takes into account TODO tests and the latter returns the actual pass/fail status.
  • Fixed a bug where SKIP tests would not be identified correctly.

TODO

  • Allow streams to be read.
  • No more dying. Instead, aggregate errors and count 'em.
  • Docs!
  • Create a separate Results.pm class?
  • Figure out the namespace.
  • Allow description transformations to be applied. For example:
    $description =~ s/\A\s*-\s*//; # remove leading '- '

It still needs a fair amount of work, though. One problem is that it currently will probably break on VMS since that system tends to put the "not" and "ok" on separate lines. That really shouldn't be too hard to parse, but I'll cross that bridge when I get there.

I'm particularly pleased about the tracking of SKIP and TODO tests. I'm tired of seeing a message like "3 tests unexpectly succeeded" and wondering where the heck they came from. When you have 400 tests scroll past your eyes, that can be tough to track down.

I also confess that I've been cribbing ideas from TAP::Harness. Joe Bob sez "check it out". (Of course, it's vaporware at this point) and I'm not sure I'd bet on it being done before the Perl 6 alpha, but if it is, it would be great.