diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-09-30 22:06:29 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-09-30 22:06:29 (GMT) |
commit | 377b06ed41b62344a7d4a5abe9cac7406fb8ef05 (patch) | |
tree | da378e8437ca90f6190b53a0daffe0344acafa72 /Source/CTest | |
parent | f2e46cf1729a012e5fc6d59d6ef6b2d5226dc52b (diff) | |
download | CMake-377b06ed41b62344a7d4a5abe9cac7406fb8ef05.zip CMake-377b06ed41b62344a7d4a5abe9cac7406fb8ef05.tar.gz CMake-377b06ed41b62344a7d4a5abe9cac7406fb8ef05.tar.bz2 |
ERR: Fix for non-gcc/icc compilers
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 42 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.h | 8 |
2 files changed, 33 insertions, 17 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index a6f1525..638a233 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -131,15 +131,22 @@ static const char* cmCTestWarningExceptions[] = { 0 }; -static cmCTestBuildHandler::cmCTestCompileErrorWarningRex +struct cmCTestBuildCompileErrorWarningRex +{ + const char* m_RegularExpressionString; + int m_FileIndex; + int m_LineIndex; +}; + +static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = { - { "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2, 0 }, - { "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2, 0 }, - { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2, 0 }, - { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2, 0 }, - { "\"([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 } + { "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 }, + { "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 }, + { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, + { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, + { "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 }, + { "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 }, + { 0, 0, 0 } }; //---------------------------------------------------------------------- @@ -150,9 +157,15 @@ cmCTestBuildHandler::cmCTestBuildHandler() int 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) ) { + r.m_FileIndex = cmCTestWarningErrorFileLine[cc].m_FileIndex; + r.m_LineIndex = cmCTestWarningErrorFileLine[cc].m_LineIndex; + } + else + { std::cout << "Problem Compiling regular expression: " << cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl; } @@ -442,14 +455,15 @@ void cmCTestBuildHandler::GenerateDartBuildOutput( << "\t\t<BuildLogLine>" << cm->m_LogLine << "</BuildLogLine>\n" << "\t\t<Text>" << m_CTest->MakeXMLSafe(cm->m_Text) << "\n</Text>" << std::endl; - int cc; - for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc ) + std::vector<cmCTestCompileErrorWarningRex>::iterator rit; + 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() ) ) { - cm->m_SourceFile = re->match(cmCTestWarningErrorFileLine[cc].m_FileIndex); - cm->m_LineNumber = atoi(re->match(cmCTestWarningErrorFileLine[cc].m_LineIndex).c_str()); + cm->m_SourceFile = re->match(rit->m_FileIndex); + cm->m_LineNumber = atoi(re->match(rit->m_LineIndex).c_str()); break; } } diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h index 6cb93e9..a5dc57a 100644 --- a/Source/CTest/cmCTestBuildHandler.h +++ b/Source/CTest/cmCTestBuildHandler.h @@ -49,15 +49,16 @@ public: void PopulateCustomVectors(cmMakefile *mf); - struct cmCTestCompileErrorWarningRex +private: + class cmCTestCompileErrorWarningRex { - char* m_RegularExpressionString; + public: + cmCTestCompileErrorWarningRex() {} int m_FileIndex; int m_LineIndex; cmsys::RegularExpression m_RegularExpression; }; -private: struct cmCTestBuildErrorWarning { bool m_Error; @@ -86,6 +87,7 @@ private: std::vector<cmStdString> m_CustomErrorExceptions; std::vector<cmStdString> m_CustomWarningMatches; std::vector<cmStdString> m_CustomWarningExceptions; + std::vector<cmCTestCompileErrorWarningRex> m_ErrorWarningFileLineRegex; }; #endif |