You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FR] Ability to register flags for custom Reporters #1885
Is your feature request related to a problem? Please describe.
If I create a custom BenchmarkReporter, I also have to instantiate it and pass it to the RunSpecifiedBenchmarks function.
I currently proxy to the default reporter while intercepting the Run results in my custom reporter, so mine always runs on top of the default behavior.
have considered adding arg parsing to main() but that is more convoluted.
Additional context
I am interested in adding a custom reporter that asserts that the run results fall within some target performance threshold. I want to be able to optionally select this reporter at runtime with a flag. Built in support for assertions on a given threshold would be a welcome alternative.
side note: it would be great to have an overload for ::benchmark::BenchmarkReporter::Run::GetAdjustedRealTime() that accepts a time unit.
adding arg parsing to main is the expected way this would work. that gives you full control over your binary. benchmark will only pull out the flags it needs and leave the rest behind.
Activity
dmah42 commentedon Dec 9, 2024
adding arg parsing to main is the expected way this would work. that gives you full control over your binary. benchmark will only pull out the flags it needs and leave the rest behind.