summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-01-12 13:51:20 -0500
committerKen Martin <ken.martin@kitware.com>2005-01-12 13:51:20 -0500
commit6207a6d0edb59d1b1682eee940d56a488277c44f (patch)
tree32580ac8e7886bbf6857aafb4a96327c46458933
parent52f7a0cce8d46ea0d2b6b1acdcc472f25bd63d81 (diff)
downloadcmake-6207a6d0edb59d1b1682eee940d56a488277c44f.tar.gz
ENH: now limits warnings and error report to 50 each
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx97
1 files changed, 63 insertions, 34 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index c49020ba9f..1b5ed6901e 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -336,6 +336,11 @@ int cmCTestBuildHandler::BuildDirectory(cmCTest *ctest_inst)
}
}
}
+
+ // the two follwing blocks of code appear wrong to me - Ken
+ // I belive that the middle if tests should be %2 type tests
+ // need to close the loop with Andy
+
// Errors exceptions
for ( cc = 0; cc < m_CustomErrorExceptions.size(); cc ++ )
{
@@ -458,47 +463,71 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
<< "</BuildCommand>" << std::endl;
std::vector<cmCTestBuildErrorWarning>::iterator it;
- for ( it = ew.begin(); it != ew.end(); it++ )
+
+ // only report the first 50 warnings and first 50 errors
+ unsigned short numErrorsAllowed = 2;
+ unsigned short numWarningsAllowed = 10;
+
+ for ( it = ew.begin();
+ it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ )
{
cmCTestBuildErrorWarning *cm = &(*it);
- os << "\t<" << (cm->m_Error ? "Error" : "Warning") << ">\n"
- << "\t\t<BuildLogLine>" << cm->m_LogLine << "</BuildLogLine>\n"
- << "\t\t<Text>" << m_CTest->MakeXMLSafe(cm->m_Text)
- << "\n</Text>" << std::endl;
- std::vector<cmCTestCompileErrorWarningRex>::iterator rit;
- for ( rit = m_ErrorWarningFileLineRegex.begin();
- rit != m_ErrorWarningFileLineRegex.end(); ++ rit )
+ if (cm->m_Error && numErrorsAllowed ||
+ !cm->m_Error && numWarningsAllowed)
{
- cmsys::RegularExpression* re = &rit->m_RegularExpression;
- if ( re->find(cm->m_Text.c_str() ) )
+ if (cm->m_Error)
{
- cm->m_SourceFile = re->match(rit->m_FileIndex);
- cm->m_LineNumber = atoi(re->match(rit->m_LineIndex).c_str());
- break;
+ numErrorsAllowed--;
}
- }
- if ( cm->m_SourceFile.size() > 0 )
- {
- os << "\t\t<SourceFile>" << cm->m_SourceFile << "</SourceFile>"
+ else
+ {
+ numWarningsAllowed--;
+ }
+ os << "\t<" << (cm->m_Error ? "Error" : "Warning") << ">\n"
+ << "\t\t<BuildLogLine>" << cm->m_LogLine << "</BuildLogLine>\n"
+ << "\t\t<Text>" << m_CTest->MakeXMLSafe(cm->m_Text)
+ << "\n</Text>" << std::endl;
+ std::vector<cmCTestCompileErrorWarningRex>::iterator rit;
+ for ( rit = m_ErrorWarningFileLineRegex.begin();
+ rit != m_ErrorWarningFileLineRegex.end(); ++ rit )
+ {
+ cmsys::RegularExpression* re = &rit->m_RegularExpression;
+ if ( re->find(cm->m_Text.c_str() ) )
+ {
+ cm->m_SourceFile = re->match(rit->m_FileIndex);
+ cm->m_LineNumber = atoi(re->match(rit->m_LineIndex).c_str());
+ break;
+ }
+ }
+ if ( cm->m_SourceFile.size() > 0 )
+ {
+ os << "\t\t<SourceFile>" << cm->m_SourceFile << "</SourceFile>"
+ << std::endl;
+ }
+ if ( cm->m_SourceFileTail.size() > 0 )
+ {
+ os << "\t\t<SourceFileTail>" << cm->m_SourceFileTail
+ << "</SourceFileTail>" << std::endl;
+ }
+ if ( cm->m_LineNumber >= 0 )
+ {
+ os << "\t\t<SourceLineNumber>" << cm->m_LineNumber
+ << "</SourceLineNumber>" << std::endl;
+ }
+ os << "\t\t<PreContext>" << m_CTest->MakeXMLSafe(cm->m_PreContext)
+ << "</PreContext>\n"
+ << "\t\t<PostContext>" << m_CTest->MakeXMLSafe(cm->m_PostContext);
+ // is this the last warning or error, if so notify
+ if (cm->m_Error && !numErrorsAllowed ||
+ !cm->m_Error && !numWarningsAllowed)
+ {
+ os << "\nThe maximum number of reported warnings or errors has been reached!!!\n";
+ }
+ os << "</PostContext>\n"
+ << "\t\t<RepeatCount>0</RepeatCount>\n"
+ << "</" << (cm->m_Error ? "Error" : "Warning") << ">\n\n"
<< std::endl;
}
- if ( cm->m_SourceFileTail.size() > 0 )
- {
- os << "\t\t<SourceFileTail>" << cm->m_SourceFileTail
- << "</SourceFileTail>" << std::endl;
- }
- if ( cm->m_LineNumber >= 0 )
- {
- os << "\t\t<SourceLineNumber>" << cm->m_LineNumber
- << "</SourceLineNumber>" << std::endl;
- }
- os << "\t\t<PreContext>" << m_CTest->MakeXMLSafe(cm->m_PreContext)
- << "</PreContext>\n"
- << "\t\t<PostContext>" << m_CTest->MakeXMLSafe(cm->m_PostContext)
- << "</PostContext>\n"
- << "\t\t<RepeatCount>0</RepeatCount>\n"
- << "</" << (cm->m_Error ? "Error" : "Warning") << ">\n\n"
- << std::endl;
}
os << "\t<Log Encoding=\"base64\" Compression=\"/bin/gzip\">\n\t</Log>\n"
<< "\t<EndDateTime>" << m_EndBuild << "</EndDateTime>\n"