36 typedef boost::program_options::options_description Syntax;
37 typedef boost::program_options::variables_map VarMap;
39 namespace op = boost::program_options;
55 : syntax(
"Run a collection of test cases. Supported parameters"),
59 (
"help,h",
"produce help message")
61 "the group (selection) of testcases to execute")
62 (
"describe", op::bool_switch(),
63 "enumerate all testcases in this Suite in a format usable with ./test.sh.")
64 (
"id", op::value<VectS>(),
65 "an individual testcase to be called.\nIf not specified, run all.")
69 op::positional_options_description posopt;
72 op::parsed_options parsed =
73 op::command_line_parser (cmdline)
79 op::store (parsed, parameters);
80 op::notify(parameters);
83 cmdline = op::collect_unrecognized(parsed.options, op::include_positional);
94 ASSERT (parameters.count (
"group"));
95 return parameters[
"group"].as<
string>();
103 if (parameters.count (
"id") &&
104 parameters[
"id"].as<VectS>().size() > 0)
105 return parameters[
"id"].as<VectS>()[0];
114 return parameters[
"describe"].as<
bool>();
124 if (parameters.count(
"help"))
136 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...