summaryrefslogtreecommitdiff
path: root/i/marvin/src/tester/tester.hh
diff options
context:
space:
mode:
authordufourj2006-04-17 08:18:37 +0000
committerdufourj2006-04-17 08:18:37 +0000
commit16302ab0ce9263a31e36b93648959575e8c5c02b (patch)
tree31cb4a869ba7741468139d17c27ccc5ae3e32a88 /i/marvin/src/tester/tester.hh
parente5996fa7074b11bce48b125756051d09de438533 (diff)
Tester :
- interfa├žage avec interpreter. TODO: - gestion du contr├┤le-c.
Diffstat (limited to 'i/marvin/src/tester/tester.hh')
-rw-r--r--i/marvin/src/tester/tester.hh20
1 files changed, 18 insertions, 2 deletions
diff --git a/i/marvin/src/tester/tester.hh b/i/marvin/src/tester/tester.hh
index c476125..5f4e68c 100644
--- a/i/marvin/src/tester/tester.hh
+++ b/i/marvin/src/tester/tester.hh
@@ -26,8 +26,10 @@
// }}}
#include "config/config.hh"
#include "interpreter/interpreter.hh"
+#include "log/data_circular_buffer_factory.hh"
#include <string>
+#include <list>
class Tester
{
@@ -38,8 +40,11 @@ class Tester
Interpreter interpreter_;
/// Program name.
std::string program_;
- /// Commands to parse.
- std::string commands_;
+ /// Internal typedef.
+ typedef std::pair<bool /*file ?*/, std::string> Opt;
+ typedef std::list<Opt> ListOpts;
+ /// Options list.
+ ListOpts listOpts_;
/// Getopt command line.
void getOpt (int argc, char **argv);
/// Print usage to stdout.
@@ -47,10 +52,21 @@ class Tester
public:
/// Constructor.
Tester (int argc, char ** argv);
+ /// Destructor.
+ virtual ~Tester (void) { }
/// Add a test function, Tester owns f.
void add (const std::string &s, Interpreter::Func *f);
/// Run commands.
+ /// Call preRun, check command, run them, call postRun.
void run (void);
+ /// Executed before checking/running commands.
+ 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