ENH: Using cmListFileCache to read the DartTestfile instead of duplicating the parse loop.

This commit is contained in:
Brad King 2003-12-05 16:39:14 -05:00
parent bcfd5ce161
commit 21c5c6c81d
1 changed files with 151 additions and 154 deletions

View File

@ -1650,21 +1650,17 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
}
int firstTest = 1;
long line = 0;
#define SPACE_REGEX "[ \t\r\n]"
cmsys::RegularExpression ireg(this->m_IncludeRegExp.c_str());
cmsys::RegularExpression ereg(this->m_ExcludeRegExp.c_str());
cmsys::RegularExpression dartStuff("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
bool parseError;
while ( fin )
{
cmListFileFunction lff;
if(cmListFileCache::ParseFunction(fin, lff, "DartTestfile.txt",
parseError, line))
cmListFileCache cache;
cmListFile* listFile = cache.GetFileCache("DartTestfile.txt", false);
for(std::vector<cmListFileFunction>::const_iterator f =
listFile->m_Functions.begin(); f != listFile->m_Functions.end(); ++f)
{
const cmListFileFunction& lff = *f;
const std::string& name = lff.m_Name;
const std::vector<cmListFileArgument>& args = lff.m_Arguments;
if (name == "SUBDIRS")
@ -1851,7 +1847,6 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
m_TestResults.push_back( cres );
}
}
}
}
int cmCTest::TestDirectory()
@ -2193,6 +2188,8 @@ std::string cmCTest::GetTestModelString()
return "Experimental";
}
#define SPACE_REGEX "[ \t\r\n]"
std::string cmCTest::GenerateRegressionImages(const std::string& xml)
{
cmsys::RegularExpression twoattributes(