Skip to content

Interpreting TAP streams lacking version numbers #41

@isaacs

Description

@isaacs

#25 (comment)

Let's pull this into a new issue here :)


eli-schwartz 1 hour ago
I implemented this in Meson as a passing test which verbosely warns you not to do this. I got a response:

mesonbuild/meson#11186 (comment)

Meson is able to parse TAP12 and TAP13, therefore it does not have to warn if the version line is missing.
IMO the "Harnesses may treat any TAP stream lacking a version as a failed test" is just silly. The point of TAP is exactly that it is easy to produce without relying on a library that handles the versioning and formatting for you, so good luck enforcing that with dozens of TAP producers.
Thoughts?

@eli-schwartz eli-schwartz 1 hour ago
More importantly:

In fact the test-anything.org page says:

Here’s what a TAP test stream looks like:

1..4
ok 1 - Input file opened
not ok 2 - First line of the input valid
ok 3 - Read the rest of the file
not ok 4 - Summarized correctly # TODO Not written yet
Which regardless of anything else seems to be a problem -- the homepage of https://testanything.org/ describes a TAP stream without the soft-mandatory version, so it is valid TAP 12 but a TAP 14 harness can report it as a test failure. Maybe this should include a version...

@bonzini bonzini 1 hour ago
Thanks for bringing it up here @eli-schwartz. In my opinion the correct reading of the spec is:

a TAP harness MUST treat a missing version line as version 12

a TAP harness MAY reject versions below any limit they would like to apply (even though it's not a good idea :))

The latter does imply rejecting input without a version line (which puts the limit at version 13), but does not mean that harnesses should warn if the version line is absent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions