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.hh32
1 files changed, 18 insertions, 14 deletions
diff --git a/i/marvin/src/tester/tester.hh b/i/marvin/src/tester/tester.hh
index 5f4e68c..ef97287 100644
--- a/i/marvin/src/tester/tester.hh
+++ b/i/marvin/src/tester/tester.hh
@@ -30,43 +30,47 @@
#include <string>
#include <list>
+#include <map>
class Tester
{
private:
+ /// DataCircularBufferFactory for beeing destruct at the end of the program.
+ /// Note : it must stay at the begining of the class !
+ DataCircularBufferFactory dbc;
/// The config.
Config config_;
- /// The interperter
+ /// The interperter.
Interpreter interpreter_;
/// Program name.
std::string program_;
- /// Internal typedef.
- typedef std::pair<bool /*file ?*/, std::string> Opt;
- typedef std::list<Opt> ListOpts;
- /// Options list.
- ListOpts listOpts_;
+ /// Description of the program.
+ std::string description_;
+ /// Commands to run.
+ std::string commands_;
/// Getopt command line.
void getOpt (int argc, char **argv);
/// Print usage to stdout.
void usage (void) const;
+ /// Print all knwon function and role to stdout.
+ void listCmd (void) const;
+ /// Show commands instead of run them.
+ bool showCmd_;
public:
/// Constructor.
- Tester (int argc, char ** argv);
+ Tester (int argc, char ** argv, const std::string &description = "");
/// Destructor.
virtual ~Tester (void) { }
- /// Add a test function, Tester owns f.
- void add (const std::string &s, Interpreter::Func *f);
+ /// Get a reference to the interpreter.
+ Interpreter &getInterpreter (void) { return interpreter_; }
/// Run commands.
/// Call preRun, check command, run them, call postRun.
void run (void);
- /// Executed before checking/running commands.
+ /// Executed before checking/running commands. Good place to add command
+ /// to the interpreter.
virtual void preRun (void) { }
/// Executed after running commands.
virtual void postRun (void) { }
- private:
- /// DataCircularBufferFactory for beeing destruct at the end of the program.
- /// It must stay at the end of the program !
- DataCircularBufferFactory dbc;
};
#endif // tester_hh