[tap-l] stream concatenation question
publiustemp-tapx at yahoo.com
Fri Aug 27 04:28:00 BST 2010
----- Original Message ----
> From: EBo <ebo at users.sourceforge.net>
> The verbose output of Test-Harness's prove utility essentially
> concatenates the results of various producers, but this concatenated output
> cannot then be re-parsed by a consumer. This may run counter to the draft
> standards directive "For maximum compatibility, it may be produced by any
> TAP producer, and must then be consumable by any TAP consumer."
Strictly speaking, prove is not a TAP producer. It merely runs the tests. It's
Test::Harness (via TAP::Harness) which consumes the TAP which in turn is
produced by the tests (and this is *usually* Perl's Test::Builder, but not
always). prove's output should not be considered TAP.
Now that I've TAP-danced around your question: this is legacy. After I
implemented subtests, I considered adding an extra switch to prove (to be passed
to the harness, perhaps) to allow the output to be rendered as subtests,
effectively allows concatenated streams and having the output be valid TAP.
There was never a pressing need for it, so I didn't bother.
> Is there already a method for dealing with concatenated streams?
> If there is not, looking at the draft standards grammar, a potential
> solution is to add an optional Test-Name to the TAP's Header EBNF grammar:
> Header = [Comments] [Version] [Comments] [Test-Name]
> Test-Name = "NAME" SP Name-String [SP Description]
> Name-String = 1*(%x21-22 %x24-FF) ; printable UTF8 without SPACE or "#"
> Perl's Test-Harness already adds the test name to the verbose output, but
> it does so in a way that is not guaranteed to be reparsable. Adding this
> name tag allows for unambiguous regrouping of the output.
You know, I think this would solve some other issues I've had with trying to
store TAP history.
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://blogs.perl.org/users/ovid/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
More information about the tap-l