CTest: Teach the launchers to honer the max warnings and errors

The ctest launcher code did not respect the number of errors and
warnings limits.  Limit the number of launcher report fragments that we
report in the final submission.
This commit is contained in:
Bill Hoffman 2014-06-24 13:35:35 -04:00 committed by Brad King
parent c196b3ca02
commit f730313143
1 changed files with 7 additions and 2 deletions

View File

@ -605,6 +605,9 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
typedef std::set<std::string, FragmentCompare> Fragments;
Fragments fragments(fragmentCompare);
// only report the first 50 warnings and first 50 errors
int numErrorsAllowed = this->MaxErrors;
int numWarningsAllowed = this->MaxWarnings;
// Identify fragments on disk.
cmsys::Directory launchDir;
launchDir.Load(this->CTestLaunchDir.c_str());
@ -612,13 +615,15 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
for(unsigned long i=0; i < n; ++i)
{
const char* fname = launchDir.GetFile(i);
if(this->IsLaunchedErrorFile(fname))
if(this->IsLaunchedErrorFile(fname) && numErrorsAllowed)
{
numErrorsAllowed--;
fragments.insert(this->CTestLaunchDir + "/" + fname);
++this->TotalErrors;
}
else if(this->IsLaunchedWarningFile(fname))
else if(this->IsLaunchedWarningFile(fname) && numWarningsAllowed)
{
numWarningsAllowed--;
fragments.insert(this->CTestLaunchDir + "/" + fname);
++this->TotalWarnings;
}