-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: -bench regexp doesn't apply to subbenchmarks #15126
Comments
@mpvl , could you look into this? |
Tests too, or just benchmarks? When I wrote https://go-review.googlesource.com/#/c/18370/, @adg asked me why not use a table-driven test. I replied in the Gerrit comments that I found regexps to be very useful for describing which tests to run. |
I couldn't figure out how to run subtests. The following example hangs forever with go tip when func TestSubtest(t *testing.T) {
t.Run("bar", func(t *testing.T) {})
t.Run("baz", func(t *testing.T) {})
} |
It applies to both tests and benchmarks. The CL to take care of this (https://go-review.googlesource.com/#/c/19122/) is the last step of the subtest/subbenchmark implementation and has taken a bit of time to review. You will be able to select subtests and subbenchmarks as you suggested once this CL is in. (the hanging was a silly thing that is fixed in tip, btw). |
@bradfitz: that was, in fact, one of my main motivations to start doing this in the first place. Run enables a bunch of other functionality that people have asked for, but I'm looking forward to using this one myself. :) |
CL https://golang.org/cl/19122 mentions this issue. |
Closing. Thanks. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go env
)?Given the following subbenchmarks:
I wanted to run only
BenchmarkFoo/sub1
with:Only
BenchmarkFoo/sub1
should be executedNo benchmarks are executed.
The text was updated successfully, but these errors were encountered: