ENH: Fix problem with Source Lines and add debugging of regular expressions

This commit is contained in:
Andy Cedilnik 2006-04-27 15:23:39 -04:00
parent 64cf77f823
commit 2ae84e5ba6

View File

@ -534,6 +534,8 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
break; break;
} }
} }
if ( !cm->SourceFile.empty() && cm->LineNumber >= 0 )
{
if ( cm->SourceFile.size() > 0 ) if ( cm->SourceFile.size() > 0 )
{ {
os << "\t\t<SourceFile>" << cm->SourceFile << "</SourceFile>" os << "\t\t<SourceFile>" << cm->SourceFile << "</SourceFile>"
@ -549,6 +551,7 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
os << "\t\t<SourceLineNumber>" << cm->LineNumber os << "\t\t<SourceLineNumber>" << cm->LineNumber
<< "</SourceLineNumber>" << std::endl; << "</SourceLineNumber>" << std::endl;
} }
}
os << "\t\t<PreContext>" << this->CTest->MakeXMLSafe(cm->PreContext) os << "\t\t<PreContext>" << this->CTest->MakeXMLSafe(cm->PreContext)
<< "</PreContext>\n" << "</PreContext>\n"
<< "\t\t<PostContext>" << this->CTest->MakeXMLSafe(cm->PostContext); << "\t\t<PostContext>" << this->CTest->MakeXMLSafe(cm->PostContext);
@ -891,6 +894,7 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
if ( !this->ErrorQuotaReached ) if ( !this->ErrorQuotaReached )
{ {
// Errors // Errors
int wrxCnt = 0;
for ( it = this->ErrorMatchRegex.begin(); for ( it = this->ErrorMatchRegex.begin();
it != this->ErrorMatchRegex.end(); it != this->ErrorMatchRegex.end();
++ it ) ++ it )
@ -898,11 +902,15 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
if ( it->find(data) ) if ( it->find(data) )
{ {
errorLine = 1; errorLine = 1;
cmCTestLog(this->CTest, DEBUG, " Error Line: " << data << std::endl); cmCTestLog(this->CTest, DEBUG, " Error Line: " << data
<< " (matches: " << this->CustomWarningMatches[wrxCnt] << ")"
<< std::endl);
break; break;
} }
wrxCnt ++;
} }
// Error exceptions // Error exceptions
wrxCnt = 0;
for ( it = this->ErrorExceptionRegex.begin(); for ( it = this->ErrorExceptionRegex.begin();
it != this->ErrorExceptionRegex.end(); it != this->ErrorExceptionRegex.end();
++ it ) ++ it )
@ -911,14 +919,17 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
{ {
errorLine = 0; errorLine = 0;
cmCTestLog(this->CTest, DEBUG, " Not an error Line: " << data cmCTestLog(this->CTest, DEBUG, " Not an error Line: " << data
<< " (matches: " << this->CustomErrorExceptions[wrxCnt] << ")"
<< std::endl); << std::endl);
break; break;
} }
wrxCnt ++;
} }
} }
if ( !this->WarningQuotaReached ) if ( !this->WarningQuotaReached )
{ {
// Warnings // Warnings
int wrxCnt = 0;
for ( it = this->WarningMatchRegex.begin(); for ( it = this->WarningMatchRegex.begin();
it != this->WarningMatchRegex.end(); it != this->WarningMatchRegex.end();
++ it ) ++ it )
@ -927,11 +938,15 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
{ {
warningLine = 1; warningLine = 1;
cmCTestLog(this->CTest, DEBUG, cmCTestLog(this->CTest, DEBUG,
" Warning Line: " << data << std::endl); " Warning Line: " << data
<< " (matches: " << this->CustomWarningMatches[wrxCnt] << ")"
<< std::endl);
break; break;
} }
wrxCnt ++;
} }
wrxCnt = 0;
// Warning exceptions // Warning exceptions
for ( it = this->WarningExceptionRegex.begin(); for ( it = this->WarningExceptionRegex.begin();
it != this->WarningExceptionRegex.end(); it != this->WarningExceptionRegex.end();
@ -941,9 +956,11 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
{ {
warningLine = 0; warningLine = 0;
cmCTestLog(this->CTest, DEBUG, " Not a warning Line: " << data cmCTestLog(this->CTest, DEBUG, " Not a warning Line: " << data
<< " (matches: " << this->CustomWarningExceptions[wrxCnt] << ")"
<< std::endl); << std::endl);
break; break;
} }
wrxCnt ++;
} }
} }
if ( errorLine ) if ( errorLine )