|
|
|
testing: use -bench flag and fix flags doc link
Patch Set 1 : diff -r 4068527655f3 https://code.google.com/p/go/ #Patch Set 2 : diff -r 4068527655f3 https://code.google.com/p/go/ #
Total comments: 3
Patch Set 3 : diff -r 71375a634b9a https://code.google.com/p/go/ #Patch Set 4 : diff -r 71375a634b9a https://code.google.com/p/go/ #Total messages: 12
|
dpiddy
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
|
12 years, 7 months ago (2013年06月14日 17:58:19 UTC) #1 |
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
https://codereview.appspot.com/10263043/diff/5001/src/pkg/testing/testing.go File src/pkg/testing/testing.go (right): https://codereview.appspot.com/10263043/diff/5001/src/pkg/testing/testing.go#... src/pkg/testing/testing.go:26: // the -bench flag is provided. Benchmarks are run sequentially. the flag is called test.bench.
On 2013年06月14日 18:10:37, r wrote: > the flag is called test.bench. I think I understand now how flags to `go test` are passed to the testing binary and that's what would make `go test -test.bench .` work. If it helps, two things that led to me thinking this snippet was incorrect were: * `go test -test.bench` spitting out the `go help` output since I didn't have a regex * `go help testflag` listing `-bench` directly Happy to remove that change if there's nothing salvageable, or add some more description if it would be helpful. There are example benchmark functions, perhaps adding an example run of `go test` would be good?
From this package's point of view, the flag is called test.bench. You can see the declaration. The go test command provides a convenient shortcut by letting you drop the "test.", but it's a property of go test, not of this package.
https://codereview.appspot.com/10263043/diff/5001/src/pkg/testing/testing.go File src/pkg/testing/testing.go (right): https://codereview.appspot.com/10263043/diff/5001/src/pkg/testing/testing.go#... src/pkg/testing/testing.go:26: // the -bench flag is provided. Benchmarks are run sequentially. s/the -bench/its -bench/
https://codereview.appspot.com/10263043/diff/5001/src/pkg/testing/testing.go File src/pkg/testing/testing.go (right): https://codereview.appspot.com/10263043/diff/5001/src/pkg/testing/testing.go#... src/pkg/testing/testing.go:26: // the -bench flag is provided. Benchmarks are run sequentially. On 2013年06月14日 20:14:32, kr wrote: > s/the -bench/its -bench/ nice solution. +1
Hello golang-dev@googlegroups.com, r@golang.org, kr@xph.us (cc: golang-dev@googlegroups.com), Please take another look.
Please sign the CLA as explained in http://golang.org/doc/contribute.html#copyright
On 2013年06月14日 20:28:52, r wrote: > Please sign the CLA as explained in > http://golang.org/doc/contribute.html#copyright Just in case it needs stating: I did that.
*** Submitted as https://code.google.com/p/go/source/detail?r=f321ae0dd9c9 *** testing: use -bench flag and fix flags doc link R=golang-dev, r, kr CC=golang-dev https://codereview.appspot.com/10263043 Committer: Brad Fitzpatrick <bradfitz@golang.org>