TAP meta information

From Test Anything Protocol

Jump to: navigation, search

It would be nice if TAP stream could contain meta information about the test, things which are not directly related to an individual test line itself.

An example of this desire is what is currently put in comments by Test.pm

 1..1
 # Running under perl version 5.008008 for darwin
 # Current time local: Sat Mar 10 16:02:01 2007
 # Current time GMT:   Sun Mar 11 00:02:01 2007
 # Using Test.pm version 1.25
 ok 1

Contents

[edit] Status

This is being considered for inclusion in a future version of TAP. But it needs to be updated to reflect reality.

[edit] For

[edit] Against

(none so far)

[edit] Fields

A set of fields will be specified. A method will be provided to allow TAP producers to output non-standard fields without fear of conflicting with future standard fields.

Use of a hierarchy rather than a flat set of fields or combining multiple values into one is encouraged. For example, instead of:

   producer: "Test.pm 1.23"

It would be:

   producer:
       name:    Test.pm
       version: 1.23

All fields, and indeed including meta information at all, are optional.


[edit] Info about the TAP producer

  • producer: Contains information about the TAP producer.
    • name:
    • version:

[edit] Environment

  • datetime: in TAP datetime format
  • Operating system
  • File system
  • Other configuration information
  • Language version and information
  • Hostname/IP address if applicable

[edit] Test information

  • Identifier (file, URL, etc...)

[edit] End of test information

  • exit status
  • wait status
  • HTTP status
  • CPU, system, real clock, i/o wait and other timing information

[edit] Reserved Fields

All fields beginning with a lower case letter are reserved.

[edit] Extensions

Non-standard fields must start with an upper case letter.

[edit] Implementation

The meta information will come after the TAP version but before the test header. The TAP diagnostic syntax is used. The benefits include: less special syntax for the TAP parser to deal with; extensible key/value pairs.

[edit] Example

 TAP version 9
     ---
     datetime: Sat Mar 10 16:04:50 PST 2007
     producer:
         name: Test.pm
         version: 1.23
     Fortune: >
         Still looking for the glorious results of my misspent youth.  Say, 
         do you have a map to the next joint?
     ...
 1..2
 ok 1
 ok 2
     ---
     exit: 0
     wait: 0
     ...
Personal tools