[tap-l] stream concatenation question

EBo ebo at users.sourceforge.net
Fri Aug 27 01:55:48 BST 2010



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."

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.

As a note, I came across this when developing a consumer for SpinalTAP's,
and using perl's verbose prove output.  I can now identify and reparse
prove's subsets:

Test Summary Report
-------------------
t/iterators.t  (Wstat: --- Test: 76 Failed: 8)
  Failed tests:  7, 8, 9, 10, 11, 12, 13, 15
t/nofork-mux.t  (Wstat: --- Test: 0 Failed: 0)
  Parse errors: No plan found in TAP output
t/regression.t  (Wstat: --- Test: 3842 Failed: 103)
  Failed tests:  2, 5, 31, 34, 58, 61, 85, 88, 114, 118, 145, 
                 146, 171, 172, 200, 201, 226, 227, 252, 255, 
                 278, 279, 308, 312, 338, 342, 368, 369, 395, 
                 396, 422, 425, 452, 454, 455, 481, 484, 509, 
                 510, 538, 539, 563, 567, 593, 597, 623, 627, 
                 653, 657, 683, 684, 686, 690, 716, 720, 746, 
                 749, 775, 776, 803, 804, 831, 832, 835, 836, 
                 837, 866, 870, 896, 897, 923, 924, 926, 927, 
                 929, 955, 958, 984, 987, 1013, 1014, 1040, 
                 1043, 1069, 1073, 1099, 1102, 1126, 1127, 
                 1129, 1133, 1159, 1163, 1189, 1190, 1192, 
                 1196, 1222, 1223, 1226, 1227, 1253, 1257
Files=1, Subsets=47 Tests=7930, TIME
Result: FAIL

I still of course have to figure out the Wstat, calculate time, and track
down the bug which is not correctly counting 955 extra tests, but this
proves the concept.

Does anyone care to comment?

  EBo --




More information about the tap-l mailing list