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
This commit is contained in:
parent
d41f97a5e6
commit
9a94d1144d
|
@ -1876,8 +1876,26 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
|
|||
lg->SetGlobalGenerator(&gg);
|
||||
cmMakefile *mf = lg->GetMakefile();
|
||||
|
||||
bool found = false;
|
||||
std::string fname = dir;
|
||||
fname += "/CTestCustom.cmake";
|
||||
if ( cmSystemTools::FileExists(fname.c_str()) )
|
||||
{
|
||||
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
|
||||
<< 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);
|
||||
|
@ -1895,12 +1913,17 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
|
|||
<< fileIt->c_str() << std::endl);
|
||||
}
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
|
||||
if ( found )
|
||||
{
|
||||
cmCTest::t_TestingHandlers::iterator it;
|
||||
for ( it = this->TestingHandlers.begin(); it != this->TestingHandlers.end(); ++ it )
|
||||
{
|
||||
it->second->PopulateCustomVectors(mf);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue