From a009038a6334cbda8dd5984dfd2f387a2ce9fdbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Stemmer?= Date: Fri, 28 Jul 2017 21:42:28 +0100 Subject: [PATCH] Set test output directly when parsing the result --- parser/parser.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/parser/parser.go b/parser/parser.go index f4feca6..ae38dd6 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -153,6 +153,7 @@ func Parse(r io.Reader, pkgName string) (*Report, error) { } else { test.Result = FAIL } + test.Output = buffer test.Name = matches[2] testTime := parseTime(matches[3]) * 10 @@ -178,13 +179,7 @@ func Parse(r io.Reader, pkgName string) (*Report, error) { } else if regexSummary.MatchString(line) { // don't store any output after the summary seenSummary = true - } else { - if !seenSummary { - if test := findTest(tests, cur); test != nil { - test.Output = append(test.Output, line) - continue - } - } + } else if !seenSummary { // buffer anything else that we didn't recognize buffer = append(buffer, line) }