("config,c", po::value<std::string>(&_config)->required(), "Configuration filename")
("kernel,k", po::value<std::vector<std::string>>(&_kernel)->multitoken()->composing()->required(), "Kernel library name, support multiple kernel libraries")
("reporter,r", po::value<std::string>(&_reporter)->default_value("standard"), "Set reporter types(standard, html, junit, csv)")
+ ("filter,f", po::value<std::string>(&_filter)->default_value(".*"), "Only run benchmarks whose name matches the regular expression pattern")
("verbose,v", po::value<int>(&_verbose)->default_value(0)->implicit_value(true), "Show verbose output")
("output,o", po::value<std::string>(&_output)->default_value(""), "Set additional strings for output file name")
;
const std::string &config(void) { return _config; }
const std::vector<std::string> &kernel(void) { return _kernel; }
const std::string &reporter(void) { return _reporter; }
+ const std::string &filter(void) { return _filter; }
const std::string &output(void) { return _output; }
int verbose(void) { return _verbose; }
std::string _config;
std::vector<std::string> _kernel;
std::string _reporter;
+ std::string _filter;
std::string _output;
int _verbose;
};
std::cout << "benchmark functions list:" << std::endl;
for (auto &&f : benchmarks)
{
- std::cout << " " << f.name << std::endl;
+ if (std::regex_match(f.name, std::regex(args.filter())))
+ {
+ std::cout << " " << f.name << std::endl;
+ }
}
}
// Set noninus configuration
nonius::configuration cfg;
cfg.reporter = reporter;
+ cfg.filter_pattern = args.filter();
cfg.verbose = args.verbose();
cfg.title = test_name;
cfg.output_file = test_name + ext;