junit: Include output in JUnit report for skipped and failed benchmarks

This commit is contained in:
Joël Stemmer
2022-06-13 00:34:20 +01:00
parent f1ad02b733
commit d05abd4130
3 changed files with 8 additions and 6 deletions

View File

@ -241,10 +241,12 @@ func createTestcaseForBenchmark(pkgName string, bm gtr.Benchmark) Testcase {
if bm.Result == gtr.Fail {
tc.Failure = &Result{
Message: "Failed",
Data: formatOutput(bm.Output, 0),
}
} else if bm.Result == gtr.Skip {
tc.Skipped = &Result{
Message: "Skipped",
Data: formatOutput(bm.Output, 0),
}
} else if len(bm.Output) > 0 {
tc.SystemOut = &Output{Data: formatOutput(bm.Output, 0)}