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) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
29 #ifndef TESTHELPER_TESTOPTION_H
30 #define TESTHELPER_TESTOPTION_H
31 
32 #include "lib/cmdline.hpp"
33 #include "lib/nocopy.hpp"
34 
35 #include <string>
36 #include <iostream>
37 #include <boost/program_options.hpp>
38 #include <boost/utility.hpp>
39 
40 
41 
42 namespace test {
43 
44  using std::string;
45  using std::ostream;
46 
47 
48 
59  class TestOption
61  {
62  public:
63  TestOption (lib::Cmdline& cmdline);
64  const string getTestgroup ();
65  const string getTestID ();
66  bool handleHelpRequest();
67  bool shouldDescribe ();
68 
69  private:
70  boost::program_options::options_description syntax;
71  boost::program_options::variables_map parameters;
72 
73  friend ostream& operator<< (ostream&, const TestOption&);
74  };
75 
76 
79  ostream& operator<< (ostream& os, const TestOption& to);
80 
81 
82 } // namespace test
83 #endif
Definition: run.hpp:49
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
const string getTestID()
Definition: testoption.cpp:101
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:92
Support for selecting and configuring testcases via commandline arguments.
Definition: testoption.hpp:59
friend ostream & operator<<(ostream &, const TestOption &)
for outputting the help messages.
Definition: testoption.cpp:134
bool handleHelpRequest()
handles the –help switch by printing a syntax description
Definition: testoption.cpp:122
TestOption(lib::Cmdline &cmdline)
set up an options parser to use the current commandline.
Definition: testoption.cpp:54
Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of stri...
Definition: cmdline.hpp:57