00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CXXTOOLS_UNIT_APPLICATION_H
00020 #define CXXTOOLS_UNIT_APPLICATION_H
00021
00022 #include <cxxtools/unit/api.h>
00023 #include <cxxtools/unit/reporter.h>
00024 #include <cxxtools/unit/test.h>
00025 #include <sstream>
00026
00027 namespace cxxtools {
00028
00029 namespace unit {
00030
00053 class CXXTOOLS_UNIT_API Application : public Test
00054 {
00055 public:
00058 Application();
00059
00062 virtual ~Application();
00063
00064 static Application& instance();
00065
00070 Test* findTest(const std::string& testname);
00071
00076 void attachReporter(Reporter& r);
00077
00083 void attachReporter(Reporter& r, const std::string& testname);
00084
00092 void run(const std::string& testName);
00093
00100 virtual void run();
00101
00103 unsigned errors() const
00104 { return _errors; }
00105
00110 static std::list<Test*>& tests();
00111
00119 void registerTest(Test& test);
00120
00121 void deregisterTest(Test& test);
00122
00123 private:
00124 static Application* _app;
00125
00128 unsigned _errors;
00129 };
00130
00131 }
00132
00133 }
00134
00135 #endif