tap

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 9 Imported by: 0

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

func Read(i io.Reader, name string, reorder bool) (Case, error)

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.

type Status

type Status int

d Status is the test status type.

func StatusFrom

func StatusFrom(str string, def Status) Status

StatusFrom returns a Status from a supplied string.

Directories

Path Synopsis
Package tojunint contains code for TAP to junit conversion.
Package tojunint contains code for TAP to junit conversion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL