summaryrefslogtreecommitdiff
path: root/i/marvin/src/tester/test_tester.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/tester/test_tester.cc')
-rw-r--r--i/marvin/src/tester/test_tester.cc27
1 files changed, 22 insertions, 5 deletions
diff --git a/i/marvin/src/tester/test_tester.cc b/i/marvin/src/tester/test_tester.cc
index 57973f6..6e1c208 100644
--- a/i/marvin/src/tester/test_tester.cc
+++ b/i/marvin/src/tester/test_tester.cc
@@ -32,6 +32,9 @@ class TestTester
{
Tester t;
public:
+ // Constructor
+ TestTester (int argc, char ** argv)
+ : t (argc, argv) { }
bool funcA (const Tester::Args &a)
{
std::cout << " a " << a << std::endl;
@@ -70,7 +73,13 @@ class TestTester
std::cout << ' ' << e.what () << std::endl;
}
}
- int main (void)
+ int run (void)
+ {
+ t.add ("m", Tester::memFunc (*this, &TestTester::main));
+ t.run ();
+ return 0;
+ }
+ bool main (void)
{
Tester::Args a[4];
// Add functions.
@@ -95,12 +104,20 @@ class TestTester
call ("d", a[i]);
call ("e", a[i]);
}
- return 0;
+ return true;
}
};
-int main (void)
+int
+main (int argc, char **argv)
{
- TestTester tt;
- return tt.main ();
+ TestTester tt (argc, argv);
+ try
+ {
+ return tt.run ();
+ }
+ catch (const std::exception &e)
+ {
+ std::cerr << e.what () << std::endl;
+ }
}