-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
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_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:
If we pass do as BENCHMARK_CAPTURE we will have an almost perfect solution.
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.
I'll leave it as it for now, what do you think? Is it useful and is possible?
Metadata
Metadata
Assignees
Labels
No labels