BUG: fix for bug #8174

This commit is contained in:
Bill Hoffman 2009-01-15 10:32:56 -05:00
parent 35e391c93b
commit be52e3b6fc
2 changed files with 14 additions and 2 deletions

View File

@ -401,7 +401,12 @@ cmCTestTestHandler::cmCTestTestHandler()
this->LogFile = 0;
this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
// regex to detect <DartMeasurement>...</DartMeasurement>
this->DartStuff.compile(
"(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
// regex to detect each individual <DartMeasurement>...</DartMeasurement>
this->DartStuff1.compile(
"(<DartMeasurement[^<]*</DartMeasurement[a-zA-Z]*>)");
}
//----------------------------------------------------------------------
@ -897,7 +902,13 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
if (this->DartStuff.find(output.c_str()))
{
std::string dartString = this->DartStuff.match(1);
cmSystemTools::ReplaceString(output, dartString.c_str(),"");
// keep searching and replacing until none are left
while (this->DartStuff1.find(output.c_str()))
{
// replace the exact match for the string
cmSystemTools::ReplaceString(output,
this->DartStuff1.match(1).c_str(), "");
}
cres.RegressionImages
= this->GenerateRegressionImages(dartString);
}

View File

@ -240,6 +240,7 @@ private:
cmsys::RegularExpression ExcludeTestsRegularExpression;
std::string GenerateRegressionImages(const std::string& xml);
cmsys::RegularExpression DartStuff1;
std::string TestsToRunString;
bool UseUnion;