mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-05 21:18:08 -05:00
Set test output directly when parsing the result
This commit is contained in:
parent
862454a821
commit
a009038a63
@ -153,6 +153,7 @@ func Parse(r io.Reader, pkgName string) (*Report, error) {
|
|||||||
} else {
|
} else {
|
||||||
test.Result = FAIL
|
test.Result = FAIL
|
||||||
}
|
}
|
||||||
|
test.Output = buffer
|
||||||
|
|
||||||
test.Name = matches[2]
|
test.Name = matches[2]
|
||||||
testTime := parseTime(matches[3]) * 10
|
testTime := parseTime(matches[3]) * 10
|
||||||
@ -178,13 +179,7 @@ func Parse(r io.Reader, pkgName string) (*Report, error) {
|
|||||||
} else if regexSummary.MatchString(line) {
|
} else if regexSummary.MatchString(line) {
|
||||||
// don't store any output after the summary
|
// don't store any output after the summary
|
||||||
seenSummary = true
|
seenSummary = true
|
||||||
} else {
|
} else if !seenSummary {
|
||||||
if !seenSummary {
|
|
||||||
if test := findTest(tests, cur); test != nil {
|
|
||||||
test.Output = append(test.Output, line)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// buffer anything else that we didn't recognize
|
// buffer anything else that we didn't recognize
|
||||||
buffer = append(buffer, line)
|
buffer = append(buffer, line)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user