...
1
3 package junitxml
4
5 import (
6 "encoding/xml"
7 )
8
9
10 type JUnitTestSuites struct {
11 XMLName xml.Name `xml:"testsuites"`
12 Suites []JUnitTestSuite `xml:"testsuite,omitempty"`
13 }
14
15
16
17 type JUnitTestSuite struct {
18 XMLName xml.Name `xml:"testsuite"`
19 Tests int `xml:"tests,attr"`
20 Failures int `xml:"failures,attr"`
21 Time string `xml:"time,attr"`
22 Name string `xml:"name,attr"`
23 Properties []JUnitProperty `xml:"properties>property,omitempty"`
24 TestCases []JUnitTestCase `xml:"testcase,omitempty"`
25 Timestamp string `xml:"timestamp,attr"`
26 }
27
28
29 type JUnitTestCase struct {
30 XMLName xml.Name `xml:"testcase"`
31 Classname string `xml:"classname,attr"`
32 Name string `xml:"name,attr"`
33 Time string `xml:"time,attr"`
34 SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
35 Failure *JUnitFailure `xml:"failure,omitempty"`
36 }
37
38
39 type JUnitSkipMessage struct {
40 Message string `xml:"message,attr"`
41 }
42
43
44 type JUnitProperty struct {
45 Name string `xml:"name,attr"`
46 Value string `xml:"value,attr"`
47 }
48
49
50 type JUnitFailure struct {
51 Message string `xml:"message,attr"`
52 Type string `xml:"type,attr"`
53 Contents string `xml:",chardata"`
54 }
55
View as plain text