27 typedef boost::program_options::options_description Syntax;
28 typedef boost::program_options::variables_map VarMap;
30 namespace op = boost::program_options;
47 : syntax(
"Run a collection of test cases. Supported parameters"),
51 (
"help,h",
"produce help message")
53 "the group (selection) of testcases to execute")
54 (
"describe", op::bool_switch(),
55 "enumerate all testcases in this Suite in a format usable with ./test.sh.")
56 (
"seed", op::value<uint64_t>(),
57 "the group (selection) of testcases to execute")
58 (
"id", op::value<VectS>(),
59 "an individual testcase to be called.\nIf not specified, run all.")
63 op::positional_options_description posopt;
66 op::parsed_options parsed =
67 op::command_line_parser (cmdline)
73 op::store (parsed, parameters);
74 op::notify(parameters);
77 cmdline = op::collect_unrecognized(parsed.options, op::include_positional);
88 ASSERT (parameters.count (
"group"));
89 return parameters[
"group"].as<
string>();
97 if (parameters.count (
"id") &&
98 parameters[
"id"].as<VectS>().size() > 0)
99 return parameters[
"id"].as<VectS>()[0];
105 TestOption::optSeed()
107 if (parameters.count (
"seed"))
108 return parameters[
"seed"].as<uint64_t>();
117 return parameters[
"describe"].as<
bool>();
127 if (parameters.count(
"help"))
139 return os << to.syntax;
Commandline options for our unittest test-suite executable.
Building and running a suite of tests, implemented as test classes.
const string getTestgroup()
Support for selecting and configuring testcases via commandline arguments.
static const string ALLGROUP
"magic" groupID containing all registered testcases
friend ostream & operator<<(ostream &, const TestOption &)
for outputting the help messages.
Lumiera error handling (C++ interface).
bool handleHelpRequest()
handles the –help switch by printing a syntax description
TestOption(lib::Cmdline &cmdline)
set up an options parser to use the current commandline.
Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of stri...