hayai icon indicating copy to clipboard operation
hayai copied to clipboard

Fixture setup with arguments

Open Lectem opened this issue 9 years ago • 6 comments

I was trying to create a fixture so that the size of the input of the test would be different among benchmarks, but with the same fixture.

Hawai doesn't do well with template fixtures, I expected as much. However I think it would be interesting to give SetUp, TearDown etc a void* parameter so that we can configure those steps per benchmark.

Lectem avatar May 29 '15 07:05 Lectem

This is a good point; I've been pondering templated benchmarks myself. I'll add this to the work of getting a version 1.0.0 out there :)

nickbruun avatar May 29 '15 08:05 nickbruun

Templated benchmarks could be useful (especially with c++11 variadic templates). But I think it shouldn't depend too much on c++11, or at least have the non-c++11 features still backward-compatible. Using lambdas as SetUp/TearDown could also be interesting

Lectem avatar May 29 '15 08:05 Lectem

Yea, dependency on C++11 is not something I'm comfortable with. However, enabling more powerful features when C++11+ is used makes sense.

nickbruun avatar May 29 '15 08:05 nickbruun

Are there any news about this topic?

MariusHerget avatar Jul 07 '16 00:07 MariusHerget

Was this implemented yet?

pdroalves avatar Jan 09 '20 18:01 pdroalves

Not yet, no. We might want to drop C++<11 support and do this :)

nickbruun avatar Jan 10 '20 04:01 nickbruun