1
0
mirror of https://github.com/golang/go synced 2024-11-18 07:24:45 -07:00
go/src/testing
Russ Cox a2a3ace51a testing: harmonize handling of prefix-matched benchmarks
If you have BenchmarkX1 with sub-benchmark Y
and you have BenchmarkX2 with no sub-benchmarks,
then

	go test -bench=X/Y

runs BenchmarkX1 once with b.N=1 (to find out about Y)
and then not again, because it has sub-benchmarks,
but arguably also because we're interested in Y.

In contrast, it runs BenchmarkX2 in full, even though clearly
that is not relevant to the match X/Y. We do have to run X2
once with b.N=1 to probe for having X2/Y, but we should not
run it with larger b.N.

Fixes #20589.

Change-Id: Ib86907e844f34dcaac6cd05757f57db1019201d0
Reviewed-on: https://go-review.googlesource.com/46031
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2017-06-20 14:19:05 +00:00
..
internal/testdeps
iotest
quick
allocs_test.go
allocs.go
benchmark_test.go
benchmark.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00
cover.go
example.go
export_test.go
helper_test.go testing: add TB.Helper to better support test helpers 2017-04-14 16:47:25 +00:00
helperfuncs_test.go testing: add TB.Helper to better support test helpers 2017-04-14 16:47:25 +00:00
match_test.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00
match.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00
sub_test.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00
testing_test.go
testing.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00