Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestCase ¶
type TestCase struct {
Name string `xml:"name,attr"`
Time float64 `xml:"time,attr"` // Seconds
ClassName string `xml:"classname,attr"`
Failure *string `xml:"failure,omitempty"`
Output *string `xml:"system-out,omitempty"`
Error *string `xml:"system-err,omitempty"`
Skipped *string `xml:"skipped,omitempty"`
Properties TestProperties `xml:"properties"`
}
TestCase holds <testcase/> results
func (*TestCase) AddProperty ¶
AddProperty adds property to testcase
func (*TestCase) GetTestStatus ¶
func (testCase *TestCase) GetTestStatus() TestStatusEnum
GetTestStatus returns the test status as a string
type TestProperties ¶
type TestProperties struct {
Properties []TestProperty `xml:"property"`
}
TestProperties is an array of test properties
type TestProperty ¶
TestProperty defines a property of the test
type TestStatusEnum ¶
type TestStatusEnum string
TestStatusEnum is a enum for test result status
const ( // Failed means junit test failed Failed TestStatusEnum = "failed" // Skipped means junit test skipped Skipped TestStatusEnum = "skipped" // Passed means junit test passed Passed TestStatusEnum = "passed" )
type TestSuite ¶
type TestSuite struct {
XMLName xml.Name `xml:"testsuite"`
Name string `xml:"name,attr"`
Time float64 `xml:"time,attr"` // Seconds
Failures int `xml:"failures,attr"`
Tests int `xml:"tests,attr"`
TestCases []TestCase `xml:"testcase"`
Properties TestProperties `xml:"properties"`
}
TestSuite holds <testSuite/> results
func (*TestSuite) AddTestCase ¶
AddTestCase adds a testcase to the testsuite
type TestSuites ¶
TestSuites holds a <testSuites/> list of TestSuite results
func UnMarshal ¶
func UnMarshal(buf []byte) (*TestSuites, error)
UnMarshal converts bytes array to TestSuites struct, it works with both TestSuites and TestSuite structs, if input is a TestSuite struct it will still return a TestSuites struct, which is an empty wrapper TestSuites containing only the input Suite
func (*TestSuites) AddTestSuite ¶
func (testSuites *TestSuites) AddTestSuite(testSuite *TestSuite) error
AddTestSuite adds TestSuite to TestSuites
func (*TestSuites) GetTestSuite ¶
func (testSuites *TestSuites) GetTestSuite(suiteName string) (*TestSuite, error)
GetTestSuite gets TestSuite struct by name