xunitapi

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Property added in v1.20.0

type Property struct {
	Name  string      `xml:"name,attr"`
	Value interface{} `xml:"value,attr"`
}

Preperty is a named property that will be formatted as an XML tag.

type Result added in v1.20.0

type Result struct {
	XMLName xml.Name
	Type    string `xml:"type,attr"`
	Message string `xml:",innerxml"`
}

Result represents the final state of the test case.

type TestCase

type TestCase struct {
	Name      string    `xml:"name,attr"`
	Time      time.Time `xml:"time,attr"`
	SystemOut string    `xml:"system-out"`
	Result    *Result   `xml:",omitempty"`
}

TestCase contains information about an individual test case.

type TestSuite

type TestSuite struct {
	Name       string `xml:"name,attr"`
	Properties struct {
		Properties []Property `xml:"property"`
	} `xml:"properties,omitempty"`
	TestCases []TestCase `xml:"testcase,omitempty"`
	Tests     int        `xml:"tests,attr"`
	Skipped   int        `xml:"skipped,attr"`
	Failures  int        `xml:"failures,attr"`
	Errors    int        `xml:"errors,attr"`
}

TestSuite contains for details about a test beyond the final status

func NewSuite added in v1.20.0

func NewSuite(name string) TestSuite

NewSuite creates a new test suite with the given name.

func (*TestSuite) AddError added in v1.20.0

func (ts *TestSuite) AddError(name string, time time.Time, logs, msg string)

AddError adds an errored test case to the suite.

func (*TestSuite) AddFailure added in v1.20.0

func (ts *TestSuite) AddFailure(name string, time time.Time, logs, msg string)

AddFailure adds a failed test case to the suite.

func (*TestSuite) AddProperty added in v1.20.0

func (ts *TestSuite) AddProperty(name, value string)

AddProperty adds the property key/value to the test suite.

func (*TestSuite) AddSuccess added in v1.20.0

func (ts *TestSuite) AddSuccess(name string, time time.Time, logs string)

AddSuccess adds a passing test case to the suite.

type TestSuites

type TestSuites struct {
	XMLName    xml.Name    `xml:"testsuites"` // Component name: <testsuites>
	Name       string      `xml:"name,attr"`
	TestSuites []TestSuite `xml:"testsuite"`
}

TestSuites is the top level object for amassing Xunit test results

func NewTestSuites added in v1.20.0

func NewTestSuites(name string, testSuites []TestSuite) TestSuites

NewTestSuites returns a new XUnit result from the given test suites.

Jump to

Keyboard shortcuts

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