1 #ifndef jb_testing_microbenchmark_group_main_hpp 2 #define jb_testing_microbenchmark_group_main_hpp 31 template <
typename config>
33 std::map<std::string, std::function<void(config const& cfg)>>;
65 template <
typename config>
71 cfg.process_cmdline(argc, argv);
77 if (bmcfg.verbose()) {
78 JB_LOG(
info) <<
"Configuration for test\n" << cfg <<
"\n";
82 auto testcase = testcases.find(bmcfg.test_case());
84 if (testcase == testcases.end()) {
85 std::ostringstream os;
86 os <<
"Unknown test case (" << bmcfg.test_case() <<
")\n";
87 os <<
" --microbenchmark.test-case must be one of:";
88 for (
auto const& i : testcases) {
89 os <<
" " << i.first <<
"\n";
94 testcase->second(cfg);
125 int argc,
char* argv[],
131 #endif // jb_testing_microbenchmark_group_main_hpp
int microbenchmark_group_main(int argc, char *argv[], microbenchmark_group< microbenchmark_config > const &testcases)
Overload microbenchmark_group_main for jb::testing::microbenchmark_config.
std::map< std::string, std::function< void(config const &cfg)> > microbenchmark_group
Define a representation for a group of microbenchmarks.
void init(config const &cfg)
Initialize the logging functions using the configuration provided.
Configure a micro-benchmark.
A simple class to communicate the result of parsing the options.
int report_exception_at_exit()
The top-level namespace for the JayBeams library.