gtr: Refactor ReportBuilder flush

This commit is contained in:
Joël Stemmer 2019-10-06 23:19:29 +01:00
parent 52a5393fd3
commit b1b88456c1

View File

@ -38,8 +38,10 @@ func (b *ReportBuilder) newId() int {
} }
func (b *ReportBuilder) flush() { func (b *ReportBuilder) flush() {
if len(b.tests) > 0 { // Create package in case we have tests or benchmarks that didn't get a
b.CreatePackage(b.packageName, 0) // summary.
if len(b.tests) > 0 || len(b.benchmarks) > 0 {
b.CreatePackage(b.packageName, 0, "")
} }
} }