Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Tuesday July 04, 2006
03:56 AM

TAP::Parser

[ #30164 ]

Some of you may be happy to know that I've started writing TAP::Parser and should have an alpha out soon. I'll be out of town through Thursday, so that will put it on hold, but I have much of the core done.

Because of the nature of what I am parsing, a lot of semantic information is being pushed into the lexer itself and anything which is not a test plan or test line is discarded. So this:

TAP version 1
1..3
ok 1 - This is a test.
... and bogus info
ok 2 - This is only a test
# this will be discarded
!!! More garbage!
not ok 3 - Had this been an actual emergency ...
#   Failed test 'Had this been an actual emergency ...'
#   in foo.t at line 5.
#          got: '42'
#     expected: 'answer'

Gets reduced down to the following:

1..3
ok 1 - This is a test.
ok 2 - This is only a test
not ok 3 - Had this been an actual emergency ...

Yes, that means diagnostic and test failure information goes straight to /dev/null and no, I'm not happy with that either. Those, however, are my marching orders. Subscribe to the Perl QA list for more information as to why that is.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • That sounds really cool. I've been thinking about how to get Perl tests integrated into CruiseControl recently, and I reckon that turning TAP output into junit's XML format will probably go a long way...

    Thanks,
    -Dom

    • Ah, cool. My first customer :)

      The interface will probably look something like this:

      my $parser = TAP::Parser->new($optional_version_number);

      $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-

      • Don't get too happy -- it's still in the thought stage over here. But I'll let you know when it gets down to some code...

        -Dom

    • See Schwern!

      I TOLD you we should have just gone with SAX itself as an event model :)

      In any case, it should hopefully be easy to move between the two.