CPAN Module Review: TAP::Parser

by chromatic

TAP::Parser is the intended replacement for the venerable Test::Harness module. The intent is to clean up the code in such a way that writing custom test harnesses and supporting new TAP features is possible. (I've hacked on Test::Harness:: Straps; it wasn't the easiest programming task I've ever tackled.)

I added TODO tests to Parrot's test tools a while ago, to make it easier to distinguish expected test failures from accidental failures. Unfortunately, Test::Harness displays very little information about TODO tests that passed. In TAP terms, these are bonus tests. The programmer expected them to fail, but they actually passed, so they need further investigation.

It would be nice to collect information on skipped, TODO, and bonus tests in the normal test run. Though I could write a harness via Test::Harness::Straps, I decided to try TAP::Parser instead. Here's what I discovered.


3 Comments

Andy Armstrong
2007-03-28 06:55:00
Anyone who's interested in grabbing the latest version - which includes the fix you mention - can find it in the Subversion repo here.


Comments about the slightly confusing documentation noted :)


One of the next things we're going to do is to refactor the display code into a separate pluggable view class. I think that should make your example easier to implement.


Thanks for the review.

Rahul
2008-06-20 11:45:52
What does the total method signify? I get errors when running your code.
chromatic
2008-06-20 12:02:19
@Rahul, at the time I wrote this, the total() method returned the total number of tests run. I haven't kept this code compatible with newer versions of TAP::Harness.