Subject: [tap] Fwd: concatenated streams discussion from tap-l

From: Gaurav Vaidya <[email-masked]>
Date: Sun, 29 Aug 2010 22:41:00 +0800

Hey everybody,

As some of you know, EBo (who's working on a TAP producer on the Plan  
9 operating system) has some ideas about adding test names into the  
TAP header and has been sharing these on the [email-masked]  
list. He's been having problems signing up for the IETF mailing list,  
and so has asked me to forward his proposal onto this list.

cheers,
Gaurav

---
From: [email-masked]
Subject: 	concatenated streams discussion from tap-l
Date: August 29, 2010 1:31:19 PM SST

While on the tap-l forum I started a thread on parsing concatenated
streams
<http://testanything.org/pipermail/tap-l/2010-August/000344.html>

The upshot of the thread is that by simply adding naming to TAP plans
allows a concatenated stream to be fully reparsed by a consumer.  I
have since modified the proposed grammar slightly to allow different
versions of TAP plans to be embedded in the stream:

=========================

; allow parsing of concatenated streams from different versions of TAP
; to be interspersed. It also allows for an empty file to be
; considered a valid TAP stream.

Stream      = *Testset
Testset     = Header [Comments] [Test-Name] (Plan Body / Body Plan)  
Footer
Test-Name   = "NAME" SP Name-String [SP Description] EOL

; test names are printable UTF8 without SPACE, DEL or "#"

Name-String = 1*(%x21-22 %x24-7E %x80-FF)

=========================

With this addition I was able to reparse Test::Harness's verbose
output and regenerate the complete plan-by-plan statistics after the
fact.  So, the results of runtests can be dumped to a file or pipe and
later parsed by consumers.  There are a number of subtle variants of
the proposed grammar which might be more suitable, but Test::Harness's
prove command already dumps the file name to the output as the first
item output, and just prior to the plan. Unfortunately it does
not explicitly tag it, so there is no way to know if this is a line to
be ignored or to be taken as the name.  Also, while the test names end
in the .t extension it is not a requirement, and a potential problem
with assuming that the name is always there could potentially break
consumers.  If we take Test::Harness as the canonical source, then the
current behavior is actually more closely interpreted as:

Testset     = Header [Comments] Test-Name (Plan Body / Body Plan) Footer
Test-Name   = Name-String [SP Description] EOL

As a note, I later discovered that naming and concatenated threads
addresses issues in the things missing from TAP document
<http://testanything.org/wiki/index.php/Things_missing_from_TAP>, but
does not address any hierarchical nesting of plans, just concatenated
ones.

Anyway, I am soliciting comments on the above proposal to add name
tags to TAPv14.

  Best regards,

  EBo --