00001 #ifndef AUTOTEST_HH 00002 #define AUTOTEST_HH 00003 00004 #include "TestSuite.hh" 00005 00006 namespace ccunit 00007 { 00029 class AutoTestSuite : public TestSuite 00030 { 00031 public: 00033 static AutoTestSuite &instance(); 00034 00036 virtual void Add(TestComponentPtr child); 00037 00039 static void finish(); 00040 00041 private: 00042 // Singleton implementation - private ctor & copying, with 00043 // no implementation on the copying. 00044 AutoTestSuite(); 00045 AutoTestSuite(const AutoTestSuite&); // Not implemented 00046 AutoTestSuite &operator=(const AutoTestSuite&); // Not implemented 00047 }; 00048 00050 template <class T> 00051 class registerTest 00052 { 00053 public: 00054 00056 registerTest() 00057 { 00058 AutoTestSuite::instance().Add(TestComponentPtr(new T)); 00059 } 00060 }; 00061 00062 } // namespace ccunit 00063 00064 #endif 00065 00066 // Local Variables: 00067 // mode: c++ 00068 // End: