Lumiera  0.pre.03
»edit your freedom«
testoption.hpp
Go to the documentation of this file.
1 /*
2  TESTOPTION.hpp - handle cmdline for invoking Testsuite
3 
4  Copyright (C)
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
20 #ifndef TESTHELPER_TESTOPTION_H
21 #define TESTHELPER_TESTOPTION_H
22 
23 #include "lib/cmdline.hpp"
24 #include "lib/nocopy.hpp"
25 
26 #include <string>
27 #include <iostream>
28 #include <optional>
29 #include <boost/program_options.hpp>
30 #include <boost/utility.hpp>
31 
32 
33 
34 namespace test {
35 
36  using std::string;
37  using std::ostream;
38 
39 
40 
51  class TestOption
53  {
54  public:
55  TestOption (lib::Cmdline& cmdline);
56  const string getTestgroup();
57  const string getTestID();
58  bool handleHelpRequest();
59  bool shouldDescribe();
60 
61  std::optional<uint64_t> optSeed();
62 
63  private:
64  boost::program_options::options_description syntax;
65  boost::program_options::variables_map parameters;
66 
67  friend ostream& operator<< (ostream&, const TestOption&);
68  };
69 
70 
73  ostream& operator<< (ostream& os, const TestOption& to);
74 
75 
76 } // namespace test
77 #endif
Definition: run.hpp:40
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
const string getTestID()
Definition: testoption.cpp:95
Class to encapsulate the typical C-style commandline definition.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
const string getTestgroup()
Definition: testoption.cpp:86
Support for selecting and configuring testcases via commandline arguments.
Definition: testoption.hpp:51
friend ostream & operator<<(ostream &, const TestOption &)
for outputting the help messages.
Definition: testoption.cpp:137
bool handleHelpRequest()
handles the –help switch by printing a syntax description
Definition: testoption.cpp:125
TestOption(lib::Cmdline &cmdline)
set up an options parser to use the current commandline.
Definition: testoption.cpp:46
Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of stri...
Definition: cmdline.hpp:48