ENH: Improve performance of testing and do not complain if DartTestfile.txt is not found or if directory does not exist
This commit is contained in:
parent
69ca8776a8
commit
e712c7c05e
@ -86,10 +86,8 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args)
|
|||||||
|
|
||||||
if ( !cmSystemTools::FileExists(fname.c_str()) )
|
if ( !cmSystemTools::FileExists(fname.c_str()) )
|
||||||
{
|
{
|
||||||
std::string m = "Could not find directory: ";
|
// No subdirectory? So what...
|
||||||
m += fname;
|
continue;
|
||||||
this->SetError(m.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
cmSystemTools::ChangeDirectory(fname.c_str());
|
cmSystemTools::ChangeDirectory(fname.c_str());
|
||||||
const char* testFilename;
|
const char* testFilename;
|
||||||
@ -105,8 +103,8 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmSystemTools::ChangeDirectory(cwd.c_str());
|
// No DartTestfile.txt? Who cares...
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
fname += "/";
|
fname += "/";
|
||||||
fname += testFilename;
|
fname += testFilename;
|
||||||
@ -291,6 +289,8 @@ cmCTestTestHandler::cmCTestTestHandler()
|
|||||||
m_CustomMaximumFailedTestOutputSize = 300 * 1024;
|
m_CustomMaximumFailedTestOutputSize = 300 * 1024;
|
||||||
|
|
||||||
m_MemCheck = false;
|
m_MemCheck = false;
|
||||||
|
|
||||||
|
m_DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -484,7 +484,6 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
|
|||||||
std::vector<cmStdString> &failed)
|
std::vector<cmStdString> &failed)
|
||||||
{
|
{
|
||||||
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
|
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
|
||||||
cmsys::RegularExpression dartStuff("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
|
|
||||||
m_TestList.clear();
|
m_TestList.clear();
|
||||||
|
|
||||||
this->GetListOfTests();
|
this->GetListOfTests();
|
||||||
@ -737,11 +736,11 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
|
|||||||
}
|
}
|
||||||
failed.push_back(testname);
|
failed.push_back(testname);
|
||||||
}
|
}
|
||||||
if (output != "")
|
if (!output.empty() && output.find("<DartMeasurement") != output.npos)
|
||||||
{
|
{
|
||||||
if (dartStuff.find(output.c_str()))
|
if (m_DartStuff.find(output.c_str()))
|
||||||
{
|
{
|
||||||
std::string dartString = dartStuff.match(1);
|
std::string dartString = m_DartStuff.match(1);
|
||||||
cmSystemTools::ReplaceString(output, dartString.c_str(),"");
|
cmSystemTools::ReplaceString(output, dartString.c_str(),"");
|
||||||
cres.m_RegressionImages = this->GenerateRegressionImages(dartString);
|
cres.m_RegressionImages = this->GenerateRegressionImages(dartString);
|
||||||
}
|
}
|
||||||
|
@ -174,6 +174,7 @@ private:
|
|||||||
std::string TestsToRunString;
|
std::string TestsToRunString;
|
||||||
bool m_UseUnion;
|
bool m_UseUnion;
|
||||||
tm_ListOfTests m_TestList;
|
tm_ListOfTests m_TestList;
|
||||||
|
cmsys::RegularExpression m_DartStuff;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user