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
00041 void
00042 private_registerTestFixture(RunnableObject& testFixture)
00043 {
00044 (privateCode::getGlobalTestSet()).insert(&testFixture);
00045 }
00046
00047
00048
00049
00050 void
00051 private_unregisterTestFixture(RunnableObject& testFixture)
00052 {
00053 (privateCode::getGlobalTestSet()).erase(&testFixture);
00054 }
00055
00056 }
00057 }