TAP version 13

From Test Anything Protocol

Jump to: navigation, search

Contents

[edit] TAP version 13

  • Status: Draft
  • Date: 2008-Apr-07
  • IANAL etc.

[edit] TAP CORE

TAP CORE is basicly TAP with a version prior to 13 (herby referred to as TAP version 12).

[edit] Example

 1..2
 ok 1
 not ok 2

TAP CORE consists of exactly one plan and as many statements as was planned. The plan may be deferred to the end of the stream, but the absence of it is a failure.

[edit] Example of deferred plan

 ok 1
 not ok 2
 1..2

[edit] TAP ENVELOPE

The TAP ENVELOPE wraps a TAP CORE stream with a TAP HEAD and a TAP TAIL.

[edit] Example

 TAP version 13
 1..2
 ok 1
 not ok 2
 TAP done

[edit] TAP COMPLETE

TAP COMPLETE consists of exactly one header

[edit] TAP META

TAP META is a YAML document included and indented consistently in the TAP stream. It can appear in numerous places, where specified.

The indentation of the YAML document start marker (---), must also indent any and all lines of the YAML document. If there is more than one YAML document, any document but the first should be ignored, and must not conflict with the exposed data structure. Parsers may make extra documents available.

[edit] META keys

Any and all keys, at any level, in all lowercase letters (as per the Unicode definition of lowercase), is reserved. Extensions should start with an uppercase letter, and the use of X- as the start of any extension-key is encouraged.

Any and all keys, at any level, defined in this specification are optional.


This section is a STUB, and needs review.


       ---
       push_down: Y
       runtime_environment:
           hostname: test.local
           ip: 127.0.0.1
           cwd: /home/user/myapp
           programming_language: Perl
           access:
               user: tester
               group: tester
           platform:
               arch: amd64
               memory: 2G
               os: linux
               os_version: 2.6.21
           producer:
               name: Spec
               version: 0.1 DRAFT
           start_time: 2008-04-06T18:30:00+2
       file: t/test.t
       url: http://tests.com/t/test.t
       line: 6
       source: is($a, $b, "They should be equal")
       tags: [basic, simple]
       results:
           have: 2
           want: 5
           compare: ==
       display: |
           got: 2
           expected: 5
       ...

[edit] TAP HEAD

TAP HEAD consists of exactly one header line, and an optional TAP META just below it

[edit] Example

TAP version 13

 ---
 X-My-Key: something something
 ...

[edit] TAP TAIL

TAP TAIL consists of exactly one tail line, and an optional TAP META just below it.

[edit] TAP PLAN

A TAP PLAN is a single line describing the number of tests that will be run.

The TAP PLAN can optionally specify a SKIP directive that may include a reason, which should be interpreted as the SKIP reason for all the TAP STATEMENTS in the TAP STREAM. This implies no tests run in this TAP STREAM

[edit] TAP STATEMENT

A TAP STATEMENT represents at least one assert, but may represent more than one assert.

A TAP STATEMENT allows an optional description right after the statement itself. The description ends with a newline or a directive.

A directive is on the form # <directive> <reason>. For now, directive can be SKIP or TODO. The reason is optional.

Personal tools