diff options
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 43964d7..12c7c80 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -24,6 +24,7 @@ #include "cmCacheManager.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" +#include "cmTest.h" #ifdef CMAKE_BUILD_WITH_CMAKE # include "cmVariableWatch.h" #endif @@ -126,6 +127,11 @@ cmMakefile::~cmMakefile() { delete *i; } + for(std::vector<cmTest*>::iterator i = m_Tests.begin(); + i != m_Tests.end(); ++i) + { + delete *i; + } for(unsigned int i=0; i < m_UsedCommands.size(); i++) { delete m_UsedCommands[i]; @@ -2465,3 +2471,43 @@ cmTarget* cmMakefile::FindTarget(const char* name) } return 0; } + +cmTest* cmMakefile::CreateTest(const char* testName) +{ + if ( !testName ) + { + return 0; + } + cmTest* test = this->GetTest(testName); + if ( test ) + { + return test; + } + test = new cmTest; + test->SetName(testName); + m_Tests.push_back(test); + return test; +} + +cmTest* cmMakefile::GetTest(const char* testName) const +{ + if ( !testName ) + { + return 0; + } + std::vector<cmTest*>::const_iterator it; + for ( it = m_Tests.begin(); it != m_Tests.end(); ++ it ) + { + if ( strcmp((*it)->GetName(), testName) == 0 ) + { + return *it; + } + } + return 0; +} + +const std::vector<cmTest*> *cmMakefile::GetTests() const +{ + return &m_Tests; +} + |