Documentation ¶
Overview ¶
Package tap parses the TAP test protocol file into a Case. TAP protocol is defined by the specification at www.testanything.org.
Index ¶
Constants ¶
View Source
const ( // UNKNOWN status represents a test of unknown status. UNKNOWN Status = Status(0) // OK status represents a passed test. PASSED = Status(1) // FAILED status represents a failed test. FAILED = Status(2) // SKIPPED status represents a test that was skipped. SKIPPED = Status(3) // TODO status represents a test that was marked TODO TODO = Status(4) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct { // Version is the TAP test specification. If unset, it is a specification // earlier than version 13. Version int // Name is the unique name of the test. Name string // First is the first test that was executed. Optional. First *int // Last is the last test. Optional. Last *int // Test results, if any. Results []Result // Raw contents of the TAPSpec Raw string // Duration is how long the test took, if known. Duration time.Duration }
Case is the result of running a TAP test suite.
func Read ¶
Read parses the contents of i into a Result. name is a given test name. If reorder is set, the Duration line will be added to the next test instead of the current, to work around issue https://github.com/bats-core/bats-core/issues/187
type Result ¶
type Result struct { // Status shows the status of this test. Status Status // Duration is how long the test took. Duration time.Duration // Header is the first line of the test, complete. Header string // Raw is the raw content of the test result dump. Raw string }
Result is the result of a single TAP test.
Click to show internal directories.
Click to hide internal directories.