1
- package formatter
1
+ package main
2
2
3
3
import (
4
4
"bufio"
8
8
"runtime"
9
9
"strings"
10
10
"time"
11
-
12
- "github.com/jstemmer/go-junit-report/parser"
13
11
)
14
12
15
13
// JUnitTestSuites is a collection of JUnit test suites.
@@ -60,7 +58,7 @@ type JUnitFailure struct {
60
58
61
59
// JUnitReportXML writes a JUnit xml representation of the given report to w
62
60
// in the format described at http://windyroad.org/dl/Open%20Source/JUnit.xsd
63
- func JUnitReportXML (report * parser. Report , noXMLHeader bool , goVersion string , w io.Writer ) error {
61
+ func JUnitReportXML (report * Report , noXMLHeader bool , goVersion string , w io.Writer ) error {
64
62
suites := JUnitTestSuites {}
65
63
66
64
// convert Report to JUnit test suites
@@ -99,7 +97,7 @@ func JUnitReportXML(report *parser.Report, noXMLHeader bool, goVersion string, w
99
97
Failure : nil ,
100
98
}
101
99
102
- if test .Result == parser . FAIL {
100
+ if test .Result == FAIL {
103
101
ts .Failures ++
104
102
testCase .Failure = & JUnitFailure {
105
103
Message : "Failed" ,
@@ -108,7 +106,7 @@ func JUnitReportXML(report *parser.Report, noXMLHeader bool, goVersion string, w
108
106
}
109
107
}
110
108
111
- if test .Result == parser . SKIP {
109
+ if test .Result == SKIP {
112
110
testCase .SkipMessage = & JUnitSkipMessage {strings .Join (test .Output , "\n " )}
113
111
}
114
112
@@ -148,12 +146,12 @@ func JUnitReportXML(report *parser.Report, noXMLHeader bool, goVersion string, w
148
146
return nil
149
147
}
150
148
151
- func mergeBenchmarks (benchmarks []* parser. Benchmark ) []* parser. Benchmark {
152
- var merged []* parser. Benchmark
153
- benchmap := make (map [string ][]* parser. Benchmark )
149
+ func mergeBenchmarks (benchmarks []* Benchmark ) []* Benchmark {
150
+ var merged []* Benchmark
151
+ benchmap := make (map [string ][]* Benchmark )
154
152
for _ , bm := range benchmarks {
155
153
if _ , ok := benchmap [bm .Name ]; ! ok {
156
- merged = append (merged , & parser. Benchmark {Name : bm .Name })
154
+ merged = append (merged , & Benchmark {Name : bm .Name })
157
155
}
158
156
benchmap [bm .Name ] = append (benchmap [bm .Name ], bm )
159
157
}
0 commit comments