Add testdata for json go test output

This commit is contained in:
Joël Stemmer
2019-10-09 00:18:04 +01:00
parent 44187d369e
commit d63613f07a
26 changed files with 491 additions and 8 deletions

View File

@ -72,12 +72,19 @@ func testRun(inputFile, reportFile string, config TestConfig, t *testing.T) {
t.Fatalf("error loading report file: %v", err)
}
parser := gotest.New(
options := []gotest.Option{
gotest.PackageName(config.packageName),
gotest.TimestampFunc(func() time.Time {
return time.Date(2022, 1, 1, 0, 0, 0, 0, time.UTC)
}),
)
}
var parser Parser
if strings.HasSuffix(inputFile, ".gojson.txt") {
parser = gotest.NewJSON(options...)
} else {
parser = gotest.New(options...)
}
report, err := parser.Parse(input)
if err != nil {