{"modulePath":"github.com/2lambda123/openshift-origin","version":"v4.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Types\n\n```go\ntype ByName []*TestSuite\n```\nByName implements sort.Interface for \\[]\\*TestSuite based on the Name field\n\n```go\nfunc (n ByName) Len() int\n```\n\n```go\nfunc (n ByName) Less(i, j int) bool\n```\n\n```go\nfunc (n ByName) Swap(i, j int)\n```\n\n```go\ntype FailureOutput struct {\n\tXMLName xml.Name `xml:\"failure\"`\n\n\t// Message holds the failure message from the test\n\tMessage string `xml:\"message,attr\"`\n\n\t// Output holds verbose failure output from the test\n\tOutput string `xml:\",chardata\"`\n}\n```\nFailureOutput holds the output from a failing test\n\n```go\ntype SkipMessage struct {\n\tXMLName xml.Name `xml:\"skipped\"`\n\n\t// Message explains why the test was skipped\n\tMessage string `xml:\"message,attr,omitempty\"`\n}\n```\nSkipMessage holds a message explaining why a test was skipped\n\n```go\ntype TestCase struct {\n\tXMLName xml.Name `xml:\"testcase\"`\n\n\t// Name is the name of the test case\n\tName string `xml:\"name,attr\"`\n\n\t// Classname is an attribute set by the package type and is required\n\tClassname string `xml:\"classname,attr,omitempty\"`\n\n\t// Duration is the time taken in seconds to run the test\n\tDuration float64 `xml:\"time,attr\"`\n\n\t// SkipMessage holds the reason why the test was skipped\n\tSkipMessage *SkipMessage `xml:\"skipped\"`\n\n\t// FailureOutput holds the output from a failing test\n\tFailureOutput *FailureOutput `xml:\"failure\"`\n\n\t// SystemOut is output written to stdout during the execution of this test case\n\tSystemOut string `xml:\"system-out,omitempty\"`\n\n\t// SystemErr is output written to stderr during the execution of this test case\n\tSystemErr string `xml:\"system-err,omitempty\"`\n}\n```\nTestCase represents a jUnit test case\n\n```go\nfunc (t *TestCase) MarkFailed(message, output string)\n```\nMarkFailed marks the test as failed with the given message and output\n\n```go\nfunc (t *TestCase) MarkSkipped(message string)\n```\nMarkSkipped marks the test as skipped with the given message\n\n```go\nfunc (t *TestCase) SetDuration(duration string) error\n```\nSetDuration sets the runtime duration of the test case\n\n```go\nfunc (t *TestCase) String() string\n```\n\n```go\ntype TestResult string\n```\nTestResult is the result of a test case\n\n```go\nconst (\n\tTestResultPass TestResult = \"pass\"\n\tTestResultSkip TestResult = \"skip\"\n\tTestResultFail TestResult = \"fail\"\n)\n```\n\n```go\ntype TestSuite struct {\n\tXMLName xml.Name `xml:\"testsuite\"`\n\n\t// Name is the name of the test suite\n\tName string `xml:\"name,attr\"`\n\n\t// NumTests records the number of tests in the TestSuite\n\tNumTests uint `xml:\"tests,attr\"`\n\n\t// NumSkipped records the number of skipped tests in the suite\n\tNumSkipped uint `xml:\"skipped,attr\"`\n\n\t// NumFailed records the number of failed tests in the suite\n\tNumFailed uint `xml:\"failures,attr\"`\n\n\t// Duration is the time taken in seconds to run all tests in the suite\n\tDuration float64 `xml:\"time,attr\"`\n\n\t// Properties holds other properties of the test suite as a mapping of name to value\n\tProperties []*TestSuiteProperty `xml:\"properties,omitempty\"`\n\n\t// TestCases are the test cases contained in the test suite\n\tTestCases []*TestCase `xml:\"testcase\"`\n\n\t// Children holds nested test suites\n\tChildren []*TestSuite `xml:\"testsuite\"`\n}\n```\nTestSuite represents a single jUnit test suite, potentially holding child suites.\n\n```go\nfunc (t *TestSuite) AddProperty(name, value string)\n```\nAddProperty adds a property to the test suite, deduplicating multiple additions of the same property by overwriting the previous record to reflect the new values\n\n```go\nfunc (t *TestSuite) AddTestCase(testCase *TestCase)\n```\nAddTestCase adds a test case to the test suite and updates test suite metrics as necessary\n\n```go\nfunc (t *TestSuite) SetDuration(duration string) error\n```\nSetDuration sets the duration of the test suite if this value is not calculated by aggregating the durations of all of the substituent test cases. This should \\*not\\* be used if the total duration of the test suite is calculated as that sum, as AddTestCase will handle that case.\n\n```go\nfunc (t *TestSuite) String() string\n```\n\n```go\ntype TestSuiteProperty struct {\n\tXMLName xml.Name `xml:\"property\"`\n\n\tName  string `xml:\"name,attr\"`\n\tValue string `xml:\"value,attr\"`\n}\n```\nTestSuiteProperty contains a mapping of a property name to a value\n\n```go\nfunc (p *TestSuiteProperty) String() string\n```\n\n```go\ntype TestSuites struct {\n\tXMLName xml.Name `xml:\"testsuites\"`\n\n\t// Suites are the jUnit test suites held in this collection\n\tSuites []*TestSuite `xml:\"testsuite\"`\n}\n```\nTestSuites represents a flat collection of jUnit test suites.\n\n```go\nfunc (t *TestSuites) String() string\n```\n\n","path":"github.com/2lambda123/openshift-origin/tools/junitreport/pkg/api","name":"api","synopsis":"","isRedistributable":true}
