36@@ -37,6 +37,7 @@ static void SetupBenchArgs(ArgsManager& argsman)
37 argsman.AddArg("-sanity-check", "Run benchmarks for only one iteration with no output", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
38 argsman.AddArg("-priority-level=<l1,l2,l3>", strprintf("Run benchmarks of one or multiple priority level(s) (%s), default: '%s'",
39 benchmark::ListPriorities(), DEFAULT_PRIORITY), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
40+ argsman.AddArg("-testdatadir", "Run benchmarks on a custom directory (default: </tmp/>)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
Why not make SetupUnitTestArgs
available and call it here instead? Delegates the responsibility of documenting the default value to that part of the code.
(Could maybe rename SetupUnitTestArgs
-> SetupTestArgs
or static BasicTestingSetup::RegisterArgs
to make it less unit test-specific and communicate how broadly it is used).
Why not make SetupUnitTestArgs
available and call it here instead? Delegates the responsibility of documenting the default value to that part of the code.
(Could maybe rename SetupUnitTestArgs
-> SetupTestArgs
or static BasicTestingSetup::RegisterArgs
to make it less unit test-specific and communicate how broadly it is used).
I think we should be careful and explicit about the features we add to other binaries. One of them could end up clashing with another functionality or be removed from a binary that was using it without us noticing it.
Agree a SetupTestArgs
may not communicate clearly enough that the function is used in a broader context. How about calling it SetupCommonTestArgs
and adding a comment about it being used in benchmarks as well? That, together with no longer marking the function static
(private to the compilation unit), might mitigate your concerns?
Agree a SetupTestArgs
may not communicate clearly enough that the function is used in a broader context. How about calling it SetupCommonTestArgs
and adding a comment about it being used in benchmarks as well? That, together with no longer marking the function static
(private to the compilation unit), might mitigate your concerns?
I’m not so in favor of mentioning upper level binaries or frameworks in lower level files but no problem in applying the suggestion.
Hmm well, I’m still a bit reluctant to it. It would add test/util/setup_common.h
dependency to the benchmark binary entry point just for a single line of code.