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
Hi. I was thinking about a way to register a test by writing as little as possible boilerplate and looking for something like:
BENCHMARK_SIMPLE(TestName) { // Benchmark subject }
The downside that you have to write second } to at least end the function. And as with BENCHMARK_F, you can't call methods afterwards.
}
BENCHMARK_F
BENCHMARK_DEFINE_SIMPLE(TestName) { // Benchmark subject } BENCHMARK_REGISTER_SIMPLE(TestName)->Setup(...)->Teardown(...);
Now we can call methods, but we have same thing as with BENCHMARK_DEFINE_F: you have to spell the name of the test twice. 100% no copypasta :smiling:
BENCHMARK_DEFINE_F
If we pass do as BENCHMARK_CAPTURE we will have an almost perfect solution.
BENCHMARK_CAPTURE
BENCHMARK_SIMPLE_CAPTURE([](benchmark::State& state){ })->Setup(...)->Teardown(...);
But we still have state argument written out. Dang it. We could remove it, but then we won't be able to get/set data from/to state.
state
I'll leave it as it for now, what do you think? Is it useful and is possible?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi. I was thinking about a way to register a test by writing as little as possible boilerplate and looking for something like:
The downside that you have to write second
}
to at least end the function.And as with
BENCHMARK_F
, you can't call methods afterwards.Now we can call methods, but we have same thing as with
BENCHMARK_DEFINE_F
: you have to spell the name of the test twice. 100% no copypasta :smiling:If we pass do as
BENCHMARK_CAPTURE
we will have an almost perfect solution.But we still have
state
argument written out. Dang it. We could remove it, but then we won't be able to get/set data from/tostate
.I'll leave it as it for now, what do you think? Is it useful and is possible?
The text was updated successfully, but these errors were encountered: