diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-07-03 02:31:30 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-07-03 02:31:30 (GMT) |
commit | bd44dc14fe2a331f4ea6ef188e6130a1d1eb4dbb (patch) | |
tree | a54b23d2c3d354981919087b7e03ea6e1c2d6ce7 | |
parent | e712c7c05e1a0aade09b98fbb52a8d95b85fc027 (diff) | |
download | CMake-bd44dc14fe2a331f4ea6ef188e6130a1d1eb4dbb.zip CMake-bd44dc14fe2a331f4ea6ef188e6130a1d1eb4dbb.tar.gz CMake-bd44dc14fe2a331f4ea6ef188e6130a1d1eb4dbb.tar.bz2 |
ENH: Improve performance by compiling regular expressions when needed
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 158e55f..fb8241b 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -167,23 +167,6 @@ cmCTestBuildHandler::cmCTestBuildHandler() m_LastErrorOrWarning = m_ErrorsAndWarnings.end(); - int cc; - for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc ) - { - 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; - m_ErrorWarningFileLineRegex.push_back(r); - } - else - { - cmCTestLog(m_CTest, ERROR_MESSAGE, "Problem Compiling regular expression: " - << cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl); - } - } } //---------------------------------------------------------------------- @@ -226,24 +209,6 @@ void cmCTestBuildHandler::Initialize() m_MaxErrors = 50; m_MaxWarnings = 50; - - int cc; - for ( cc = 0; cmCTestWarningErrorFileLine[cc].m_RegularExpressionString; ++ cc ) - { - 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; - m_ErrorWarningFileLineRegex.push_back(r); - } - else - { - cmCTestLog(m_CTest, ERROR_MESSAGE, "Problem Compiling regular expression: " - << cmCTestWarningErrorFileLine[cc].m_RegularExpressionString << std::endl); - } - } } //---------------------------------------------------------------------- @@ -266,6 +231,24 @@ int cmCTestBuildHandler::ProcessHandler() { cmCTestLog(m_CTest, HANDLER_OUTPUT, "Build project" << std::endl); + int entry; + for ( entry = 0; cmCTestWarningErrorFileLine[entry].m_RegularExpressionString; ++ entry ) + { + cmCTestBuildHandler::cmCTestCompileErrorWarningRex r; + if ( r.m_RegularExpression.compile( + cmCTestWarningErrorFileLine[entry].m_RegularExpressionString) ) + { + r.m_FileIndex = cmCTestWarningErrorFileLine[entry].m_FileIndex; + r.m_LineIndex = cmCTestWarningErrorFileLine[entry].m_LineIndex; + m_ErrorWarningFileLineRegex.push_back(r); + } + else + { + cmCTestLog(m_CTest, ERROR_MESSAGE, "Problem Compiling regular expression: " + << cmCTestWarningErrorFileLine[entry].m_RegularExpressionString << std::endl); + } + } + // Determine build command and build directory const std::string &makeCommand = m_CTest->GetCTestConfiguration("MakeCommand"); if ( makeCommand.size() == 0 ) |