]> Cypherpunks repositories - gostls13.git/commit
go/types: turn TestBenchmark into a normal benchmark
authorRob Findley <rfindley@google.com>
Mon, 28 Sep 2020 15:13:14 +0000 (11:13 -0400)
committerRobert Findley <rfindley@google.com>
Thu, 1 Oct 2020 13:34:53 +0000 (13:34 +0000)
commit734790716469c7dd887a1f31b8700d42e9cb3e29
treede9d020bf2e89f7a6749ce11495946690e733973
parent069aef4067480ab29f5788b31171054954577661
go/types: turn TestBenchmark into a normal benchmark

TestBenchmark doesn't use the -bench flag, so that it can format custom
output -- the number of checked lines per second. This is a barrier both
to discoverability, and to piping benchmark output into analysis tools
such as benchstat.

Using testing.B.ReportMetric and a bit of manual timing, we can achieve
similar results while conforming to normal benchmark output. Do this,
and rename the test func to BenchmarkCheck (for symmetry with
TestCheck).

Change-Id: Ie8f2259c1ca9e6986f0137287acf8eb2843f96b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/257958
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/self_test.go