autoregister.cpp

Go to the documentation of this file.
00001 
00016 #ifndef DLR_TEST_USE_AUTOMATIC_MAIN
00017 #define DLR_TEST_USE_AUTOMATIC_MAIN
00018 #endif
00019 
00020 #include <dlrTest/autoregister.h>
00021 #include <dlrTest/runnableObject.h>
00022 
00023 namespace dlr {
00024 
00025   namespace test {
00026 
00028     namespace privateCode {
00029 
00030       std::set<RunnableObject*>&
00031       getGlobalTestSet() {
00032         static std::set<RunnableObject*> globalTestSet;
00033         return globalTestSet;
00034       }
00035       
00036     }
00038 
00039 
00040     // Schedule a TestFixture to be run automatically.
00041     void
00042     private_registerTestFixture(RunnableObject& testFixture)
00043     {
00044       (privateCode::getGlobalTestSet()).insert(&testFixture);
00045     }
00046 
00047 
00048     // Un-schedule a TestFixture so that it will no longer be run
00049     // automatically.
00050     void
00051     private_unregisterTestFixture(RunnableObject& testFixture)
00052     {
00053       (privateCode::getGlobalTestSet()).erase(&testFixture);
00054     }
00055 
00056   }
00057 }

Generated on Wed Nov 25 01:02:07 2009 for dlrTest Utility Library by  doxygen 1.5.8