We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When selecting -all in gotests, Benchmark functions should be avoided for test generation purposes.
The text was updated successfully, but these errors were encountered:
@zerjioang: This does sound like a bug. Can you please provide an example code file where this happens?
Sorry, something went wrong.
@cweill, when I execute the gotests with -all flag, the functions with following header definition:
func BenchmarkGetState(b *testing.B){}
are also treated as test candidate generating following code snippet:
func TestBenchmarkGetState(t *testing.T) { type args struct { b *testing.B } tests := []struct { name string args args }{ // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { BenchmarkGetState(tt.args.b) }) } }
I wont consider this as a bug, but could be a great improvement for those project that have Test functions and Benchmarks.
The way I found to fix this is using the regular expression option an running it via:
${GOPATH}/bin/gotests -excl Benchmark.* -w ${file}
No branches or pull requests
When selecting -all in gotests, Benchmark functions should be avoided for test generation purposes.
The text was updated successfully, but these errors were encountered: