gtr,parser/gotest: move Event and building a report to parser/gotest

The Parse method now directly returns a report, rather than a list of
events that then need to be converted into a report. As part of this
change, the Event struct has also been moved to the gotest package. It's
now the responsibility of the parser to construct a gtr.Report.
This commit is contained in:
Joël Stemmer
2022-03-14 23:17:57 +00:00
parent 832cc97037
commit c78e04707f
9 changed files with 272 additions and 252 deletions

View File

@ -0,0 +1,25 @@
package gotest
import "time"
// Event is a single event in a test or benchmark.
type Event struct {
Type string
Name string
Result string
Duration time.Duration
Data string
Indent int
// Code coverage
CovPct float64
CovPackages []string
// Benchmarks
Iterations int64
NsPerOp float64
MBPerSec float64
BytesPerOp int64
AllocsPerOp int64
}