Documentation
¶
Index ¶
Constants ¶
View Source
const ( AttachmentRegex = `\[\[ATTACHMENT\|(?<path>[^\[\]\|]+?)\]\]` PropertyRegex = `\[\[PROPERTY\|(?<name>[^\[\]\|=]+)=(?<value>[^\[\]\|=]+)\]\]` )
Variables ¶
This section is empty.
Functions ¶
func ParseTextAttachments ¶
Types ¶
type Property ¶
type Property struct {
// XMLName xml.Name `xml:"property"`
Name string `xml:"name,attr,omitempty"`
Value string `xml:"value,attr,omitempty"`
Text string `xml:",innerxml"`
}
func ParseTextProperties ¶
type Skipped ¶
type Skipped struct {
// XMLName xml.Name `xml:"skipped"`
Message string `xml:"message,attr,omitempty"`
}
type SystemErr ¶
type SystemErr struct {
// XMLName xml.Name `xml:"system-err"`
Text string `xml:",innerxml"`
}
type SystemOut ¶
type SystemOut struct {
// XMLName xml.Name `xml:"system-out"`
Text string `xml:",innerxml"`
}
type TestCase ¶
type TestCase struct {
// XMLName xml.Name `xml:"testcase"`
Name string `xml:"name,attr,omitempty"`
Classname string `xml:"classname,attr,omitempty"`
Tests int `xml:"tests,attr,omitempty"`
Time float64 `xml:"time,attr,omitempty"`
File string `xml:"file,attr,omitempty"`
Line int `xml:"line,attr,omitempty"`
Failure *Failure `xml:"failure"`
Error *Error `xml:"error"`
Skipped *Skipped `xml:"skipped"`
Properties []Property `xml:"properties>property,omitempty"`
SystemOut *SystemOut `xml:"system-out"`
SystemErr *SystemErr `xml:"system-err"`
}
type TestReport ¶
type TestReport struct {
XMLName xml.Name `xml:"testsuites"`
Tests int `xml:"tests,attr,omitempty"`
Failures int `xml:"failures,attr,omitempty"`
Errors int `xml:"errors,attr,omitempty"`
Skipped int `xml:"skipped,attr,omitempty"`
Time float64 `xml:"time,attr,omitempty"`
Timestamp string `xml:"timestamp,attr,omitempty"`
TestSuites []TestSuite `xml:"testsuite"`
}
func Merge ¶
func Merge(reports []TestReport) TestReport
Merge combines multiple TestReport items into one. The timestamp of final report will be left empty.
func Parse ¶
func Parse(r io.Reader) (TestReport, error)
Parse reads XML-encoded data from the given reader and decodes it into a TestReport struct.
func ParseMany ¶
func ParseMany(r io.Reader) ([]TestReport, error)
ParseMany works like Parse but supports reading multiple <testsuites> root elements and returns a TestReport for each of them.
type TestSuite ¶
type TestSuite struct {
// XMLName xml.Name `xml:"testsuite"`
Name string `xml:"name,attr,omitempty"`
Tests int `xml:"tests,attr,omitempty"`
Failures int `xml:"failures,attr,omitempty"`
Errors int `xml:"errors,attr,omitempty"`
Skipped int `xml:"skipped,attr,omitempty"`
Time float64 `xml:"time,attr,omitempty"`
Timestamp string `xml:"timestamp,attr,omitempty"`
File string `xml:"file,attr,omitempty"`
Properties []Property `xml:"properties>property,omitempty"`
SystemOut *SystemOut `xml:"system-out"`
SystemErr *SystemErr `xml:"system-err"`
TestCases []TestCase `xml:"testcase"`
}
Click to show internal directories.
Click to hide internal directories.