benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

[FR] Provide current benchmark information

Open SunBlack opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. Currently at GoogleTest we use the name of the test to create a unique folder per test where the tests should write (so that the folder names are unique, but also easy to find when debugging for example). So we are using the data provided by testing::UnitTest::GetInstance()->current_test_info() in a helper class. Sadly, there is nothing similar in the Benchmark library.

Describe the solution you'd like Provide a way to retrieve information about the current running benchmark - similar to TestParamInfo of GoogleTest.

SunBlack avatar Oct 10 '23 13:10 SunBlack

Am I wrong, or does benchmark::State already provide all the required information about the benchmark?

EfesX avatar Feb 09 '25 11:02 EfesX

yes i'm surprised that State doesn't hold what you'd need as it's used to output this information in the reports.

dmah42 avatar Feb 10 '25 17:02 dmah42

I suppose we could easily add family_index/per_family_instance_index/repetition_index to State (currently they are only in Run).

LebedevRI avatar Feb 10 '25 17:02 LebedevRI