ERR: Fix for non-gcc/icc compilers
This commit is contained in:
parent
f2e46cf172
commit
377b06ed41
@ -131,15 +131,22 @@ static const char* cmCTestWarningExceptions[] = {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
static cmCTestBuildHandler::cmCTestCompileErrorWarningRex
|
struct cmCTestBuildCompileErrorWarningRex
|
||||||
|
{
|
||||||
|
const char* m_RegularExpressionString;
|
||||||
|
int m_FileIndex;
|
||||||
|
int m_LineIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
static cmCTestBuildCompileErrorWarningRex
|
||||||
cmCTestWarningErrorFileLine[] = {
|
cmCTestWarningErrorFileLine[] = {
|
||||||
{ "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2, 0 },
|
{ "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 },
|
||||||
{ "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2, 0 },
|
{ "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 },
|
||||||
{ "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2, 0 },
|
{ "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
|
||||||
{ "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2, 0 },
|
{ "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
|
||||||
{ "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2, 0 },
|
{ "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 },
|
||||||
{ "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2, 0 },
|
{ "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -150,9 +157,15 @@ cmCTestBuildHandler::cmCTestBuildHandler()
|
|||||||
int cc;
|
int cc;
|
||||||
for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc )
|
for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc )
|
||||||
{
|
{
|
||||||
if ( !cmCTestWarningErrorFileLine[cc].m_RegularExpression.compile(
|
cmCTestBuildHandler::cmCTestCompileErrorWarningRex r;
|
||||||
|
if ( r.m_RegularExpression.compile(
|
||||||
cmCTestWarningErrorFileLine[cc].m_RegularExpressionString) )
|
cmCTestWarningErrorFileLine[cc].m_RegularExpressionString) )
|
||||||
{
|
{
|
||||||
|
r.m_FileIndex = cmCTestWarningErrorFileLine[cc].m_FileIndex;
|
||||||
|
r.m_LineIndex = cmCTestWarningErrorFileLine[cc].m_LineIndex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
std::cout << "Problem Compiling regular expression: "
|
std::cout << "Problem Compiling regular expression: "
|
||||||
<< cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl;
|
<< cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl;
|
||||||
}
|
}
|
||||||
@ -442,14 +455,15 @@ void cmCTestBuildHandler::GenerateDartBuildOutput(
|
|||||||
<< "\t\t<BuildLogLine>" << cm->m_LogLine << "</BuildLogLine>\n"
|
<< "\t\t<BuildLogLine>" << cm->m_LogLine << "</BuildLogLine>\n"
|
||||||
<< "\t\t<Text>" << m_CTest->MakeXMLSafe(cm->m_Text)
|
<< "\t\t<Text>" << m_CTest->MakeXMLSafe(cm->m_Text)
|
||||||
<< "\n</Text>" << std::endl;
|
<< "\n</Text>" << std::endl;
|
||||||
int cc;
|
std::vector<cmCTestCompileErrorWarningRex>::iterator rit;
|
||||||
for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc )
|
for ( rit = m_ErrorWarningFileLineRegex.begin();
|
||||||
|
rit != m_ErrorWarningFileLineRegex.end(); ++ rit )
|
||||||
{
|
{
|
||||||
cmsys::RegularExpression* re = &cmCTestWarningErrorFileLine[cc].m_RegularExpression;
|
cmsys::RegularExpression* re = &rit->m_RegularExpression;
|
||||||
if ( re->find(cm->m_Text.c_str() ) )
|
if ( re->find(cm->m_Text.c_str() ) )
|
||||||
{
|
{
|
||||||
cm->m_SourceFile = re->match(cmCTestWarningErrorFileLine[cc].m_FileIndex);
|
cm->m_SourceFile = re->match(rit->m_FileIndex);
|
||||||
cm->m_LineNumber = atoi(re->match(cmCTestWarningErrorFileLine[cc].m_LineIndex).c_str());
|
cm->m_LineNumber = atoi(re->match(rit->m_LineIndex).c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,15 +49,16 @@ public:
|
|||||||
|
|
||||||
void PopulateCustomVectors(cmMakefile *mf);
|
void PopulateCustomVectors(cmMakefile *mf);
|
||||||
|
|
||||||
struct cmCTestCompileErrorWarningRex
|
private:
|
||||||
|
class cmCTestCompileErrorWarningRex
|
||||||
{
|
{
|
||||||
char* m_RegularExpressionString;
|
public:
|
||||||
|
cmCTestCompileErrorWarningRex() {}
|
||||||
int m_FileIndex;
|
int m_FileIndex;
|
||||||
int m_LineIndex;
|
int m_LineIndex;
|
||||||
cmsys::RegularExpression m_RegularExpression;
|
cmsys::RegularExpression m_RegularExpression;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
|
||||||
struct cmCTestBuildErrorWarning
|
struct cmCTestBuildErrorWarning
|
||||||
{
|
{
|
||||||
bool m_Error;
|
bool m_Error;
|
||||||
@ -86,6 +87,7 @@ private:
|
|||||||
std::vector<cmStdString> m_CustomErrorExceptions;
|
std::vector<cmStdString> m_CustomErrorExceptions;
|
||||||
std::vector<cmStdString> m_CustomWarningMatches;
|
std::vector<cmStdString> m_CustomWarningMatches;
|
||||||
std::vector<cmStdString> m_CustomWarningExceptions;
|
std::vector<cmStdString> m_CustomWarningExceptions;
|
||||||
|
std::vector<cmCTestCompileErrorWarningRex> m_ErrorWarningFileLineRegex;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user