]> Cypherpunks repositories - gostls13.git/commit
testing: add -test.count flag to run tests and benchmarks multiple times
authorRuss Cox <rsc@golang.org>
Thu, 4 Jun 2015 02:21:07 +0000 (22:21 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 5 Jun 2015 04:31:10 +0000 (04:31 +0000)
commitfddc3ca11c38b063cb24e14d99cc023e746d0e20
treee8508747e2dce5064d131b72eece371e3dde4569
parentde305a197f5c9ca3bb09da024e06ba7be0c7435d
testing: add -test.count flag to run tests and benchmarks multiple times

The flag is available from the go test command as -count:

% go test -run XXX -bench . -count 3
PASS
BenchmarkSprintfEmpty       30000000         54.0 ns/op
BenchmarkSprintfEmpty       30000000         51.9 ns/op
BenchmarkSprintfEmpty       30000000         53.8 ns/op
BenchmarkSprintfString      10000000        238 ns/op
BenchmarkSprintfString      10000000        239 ns/op
BenchmarkSprintfString      10000000        234 ns/op
BenchmarkSprintfInt         10000000        232 ns/op
BenchmarkSprintfInt         10000000        226 ns/op
BenchmarkSprintfInt         10000000        225 ns/op
...

If -cpu is set, each test is run n times for each cpu value.

Original by r (CL 10663).

Change-Id: If3dfbdf21698952daac9249b5dbca66f5301e91b
Reviewed-on: https://go-review.googlesource.com/10669
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/go/alldocs.go
src/cmd/go/test.go
src/cmd/go/testflag.go
src/testing/testing.go