Skip to content

Commit 50c1179

Browse files
committed
parser/gotest: Remove benchmark specific methods from reportBuilder
1 parent 9d434fa commit 50c1179

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

parser/gotest/report_builder.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ func (b *reportBuilder) ProcessEvent(ev Event) {
6363
case "end_test":
6464
b.EndTest(ev.Name, ev.Result, ev.Duration, ev.Indent)
6565
case "run_benchmark":
66-
b.CreateBenchmark(ev.Name)
66+
b.CreateTest(ev.Name)
6767
case "benchmark":
6868
b.BenchmarkResult(ev.Name, ev.Iterations, ev.NsPerOp, ev.MBPerSec, ev.BytesPerOp, ev.AllocsPerOp)
6969
case "end_benchmark":
70-
b.EndBenchmark(ev.Name, ev.Result)
70+
b.EndTest(ev.Name, ev.Result, 0, 0)
7171
case "status":
7272
b.End()
7373
case "summary":
@@ -157,14 +157,6 @@ func (b *reportBuilder) End() {
157157
b.lastID = 0
158158
}
159159

160-
// CreateBenchmark adds a benchmark with the given name to the report, and
161-
// marks it as active. If more than one benchmark exists with this name, the
162-
// most recently created benchmark will be updated. If no benchmark exists with
163-
// this name, a new benchmark is created.
164-
func (b *reportBuilder) CreateBenchmark(name string) {
165-
b.CreateTest(name)
166-
}
167-
168160
// BenchmarkResult updates an existing or adds a new test with the given
169161
// results and marks it as active. If an existing test with this name exists
170162
// but without result, then that one is updated. Otherwise a new one is added
@@ -184,14 +176,6 @@ func (b *reportBuilder) BenchmarkResult(name string, iterations int64, nsPerOp,
184176
b.tests[id] = test
185177
}
186178

187-
// EndBenchmark finds the benchmark with the given name and sets the result. If
188-
// more than one benchmark exists with this name, the most recently created
189-
// benchmark will be used. If no benchmark exists with this name, a new
190-
// benchmark is created.
191-
func (b *reportBuilder) EndBenchmark(name, result string) {
192-
b.EndTest(name, result, 0, 0)
193-
}
194-
195179
// CreateBuildError creates a new build error and marks it as active.
196180
func (b *reportBuilder) CreateBuildError(packageName string) {
197181
id := b.newID()

0 commit comments

Comments
 (0)