summaryrefslogtreecommitdiff
path: root/i/marvin/src/tester/tester.hh
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/tester/tester.hh')
-rw-r--r--i/marvin/src/tester/tester.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/i/marvin/src/tester/tester.hh b/i/marvin/src/tester/tester.hh
index 15ad9dc..e38967d 100644
--- a/i/marvin/src/tester/tester.hh
+++ b/i/marvin/src/tester/tester.hh
@@ -25,8 +25,10 @@
//
// }}}
#include "utils/any.hh"
+#include "config/config.hh"
#include <map>
+#include <string>
class Tester
{
@@ -55,16 +57,36 @@ class Tester
typedef std::map<std::string, Func *> Funcs;
/// The function map itself.
Funcs funcs_;
+ /// The config.
+ Config config_;
+ /// Program name.
+ std::string program_;
+ /// Commands to parse.
+ std::string commands_;
+ /// Getopt command line.
+ void getOpt (int argc, char **argv);
+ /// Run command list.
+ /// If check is true, the command list will be checked, otherwise, it
+ /// will be executed. If check failed, it throw an exception.
+ void parse (const std::string &command, bool check);
+ /// Print usage to stdout.
+ void usage (void);
public:
+ /// Constructor.
+ Tester (int argc, char ** argv);
/// Destructor.
~Tester (void);
/// Add a test function, Tester owns f.
void add (const std::string &s, Func *f);
/// Call a test function by name.
bool call (const std::string &s, const Args &a) const;
+ /// Check function exists.
+ bool exist (const std::string &s);
/// Take all the template sophistications out of the programmer hands.
template<class T, typename F>
static Func *memFunc (T &i, F f);
+ /// Run commands.
+ void run (void);
};
#include "tester.tcc"