stack

package
v3.7.62-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser(builder builder.TestSuitesBuilder, testParser TestDataParser, suiteParser TestSuiteDataParser, stream bool) parser.TestOutputParser

NewParser returns a new parser that's capable of parsing Go unit test output

Types

type TestDataParser

type TestDataParser interface {
	// MarksBeginning determines if the line marks the beginning of a test case
	MarksBeginning(line string) bool

	// ExtractName extracts the name of the test case from test output lines
	ExtractName(line string) (name string, succeeded bool)

	// ExtractResult extracts the test result from a test output line
	ExtractResult(line string) (result api.TestResult, succeeded bool)

	// ExtractDuration extracts the test duration from a test output line
	ExtractDuration(line string) (duration string, succeeded bool)

	// ExtractMessage extracts a message (e.g. for signalling why a failure or skip occurred) from a test output line
	ExtractMessage(line string) (message string, succeeded bool)

	// MarksCompletion determines if the line marks the completion of a test case
	MarksCompletion(line string) bool
}

TestDataParser knows how to take raw test data and extract the useful information from it

type TestSuiteDataParser

type TestSuiteDataParser interface {
	// MarksBeginning determines if the line marks the beginning of a test suite
	MarksBeginning(line string) bool

	// ExtractName extracts the name of the test suite from a test output line
	ExtractName(line string) (name string, succeeded bool)

	// ExtractProperties extracts any metadata properties of the test suite from a test output line
	ExtractProperties(line string) (properties map[string]string, succeeded bool)

	// MarksCompletion determines if the line marks the completion of a test suite
	MarksCompletion(line string) bool
}

TestSuiteDataParser knows how to take raw test suite data and extract the useful information from it

type TestSuiteStack

type TestSuiteStack interface {
	// Push adds the testSuite to the top of the LIFO
	Push(pkg *api.TestSuite)
	// Pop removes the head of the LIFO and returns it
	Pop() *api.TestSuite
	// Peek returns a reference to the head of the LIFO without removing it
	Peek() *api.TestSuite
	// IsEmpty determines if the stack has any members
	IsEmpty() bool
}

TestSuiteStack is a data structure that holds api.TestSuite objects in a LIFO

func NewTestSuiteStack

func NewTestSuiteStack() TestSuiteStack

NewTestSuiteStack returns a new TestSuiteStack

Jump to

Keyboard shortcuts

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