summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-21 21:39:50 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-21 21:39:50 (GMT)
commit9a94d1144da4b6ceb1275c59ef1fb8acf17acade (patch)
tree3a3f328f30c083a634c306d3ef970c843d7f59c6 /Source/cmCTest.cxx
parentd41f97a5e6fb47399cff87aa96979f6b7196a763 (diff)
downloadCMake-9a94d1144da4b6ceb1275c59ef1fb8acf17acade.zip
CMake-9a94d1144da4b6ceb1275c59ef1fb8acf17acade.tar.gz
CMake-9a94d1144da4b6ceb1275c59ef1fb8acf17acade.tar.bz2
ENH: Two things. If there is CTestCustom.cmake in the toplevel directory read that file only. If there is CTestCustom.ctest in the toplevel directory, do the glob, if there is none, do nothing
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx51
1 files changed, 37 insertions, 14 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 4e941af..c9e7dfc 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1876,30 +1876,53 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
lg->SetGlobalGenerator(&gg);
cmMakefile *mf = lg->GetMakefile();
- std::string rexpr = dir;
- rexpr += "/CTestCustom.ctest";
- cmsys::Glob gl;
- gl.RecurseOn();
- gl.FindFiles(rexpr);
- std::vector<std::string>& files = gl.GetFiles();
- std::vector<std::string>::iterator fileIt;
- for ( fileIt = files.begin(); fileIt != files.end();
- ++ fileIt )
+ bool found = false;
+ std::string fname = dir;
+ fname += "/CTestCustom.cmake";
+ if ( cmSystemTools::FileExists(fname.c_str()) )
{
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
- << fileIt->c_str() << std::endl);
- if ( !lg->GetMakefile()->ReadListFile(0, fileIt->c_str()) ||
+ << fname.c_str() << std::endl);
+ if ( !lg->GetMakefile()->ReadListFile(0, fname.c_str()) ||
cmSystemTools::GetErrorOccuredFlag() )
{
cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: "
+ << fname.c_str() << std::endl);
+ }
+ found = true;
+ }
+
+ std::string rexpr = dir;
+ rexpr += "/CTestCustom.ctest";
+ if ( !found && cmSystemTools::FileExists(fname.c_str()) )
+ {
+ cmsys::Glob gl;
+ gl.RecurseOn();
+ gl.FindFiles(rexpr);
+ std::vector<std::string>& files = gl.GetFiles();
+ std::vector<std::string>::iterator fileIt;
+ for ( fileIt = files.begin(); fileIt != files.end();
+ ++ fileIt )
+ {
+ cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< fileIt->c_str() << std::endl);
+ if ( !lg->GetMakefile()->ReadListFile(0, fileIt->c_str()) ||
+ cmSystemTools::GetErrorOccuredFlag() )
+ {
+ cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: "
+ << fileIt->c_str() << std::endl);
+ }
}
+ found = true;
}
- cmCTest::t_TestingHandlers::iterator it;
- for ( it = this->TestingHandlers.begin(); it != this->TestingHandlers.end(); ++ it )
+ if ( found )
{
- it->second->PopulateCustomVectors(mf);
+ cmCTest::t_TestingHandlers::iterator it;
+ for ( it = this->TestingHandlers.begin(); it != this->TestingHandlers.end(); ++ it )
+ {
+ it->second->PopulateCustomVectors(mf);
+ }
}
return 1;