[Cmake-commits] CMake branch, next, updated. v2.8.7-2903-gac67898

Brad King brad.king at kitware.com
Mon Feb 27 09:03:05 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ac678983ec7eefc465ec51e29cbb067b95e244a7 (commit)
       via  f5cf8f9897fc372ae75eafa4ed3e8e68ac1fcfa9 (commit)
      from  cf6c0f190486cfa5a7b3b1fa13e7ad8a67fa2ce8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac678983ec7eefc465ec51e29cbb067b95e244a7
commit ac678983ec7eefc465ec51e29cbb067b95e244a7
Merge: cf6c0f1 f5cf8f9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Feb 27 09:03:03 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Feb 27 09:03:03 2012 -0500

    Merge topic 'escape-test-pass-regex' into next
    
    f5cf8f9 Tests: Escape metachars before embedding paths into the regex (#12999)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5cf8f9897fc372ae75eafa4ed3e8e68ac1fcfa9
commit f5cf8f9897fc372ae75eafa4ed3e8e68ac1fcfa9
Author:     Modestas Vainius <modax at debian.org>
AuthorDate: Mon Feb 27 09:00:46 2012 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 27 09:01:10 2012 -0500

    Tests: Escape metachars before embedding paths into the regex (#12999)
    
    ${CMake_SOURCE_DIR} and ${CMake_BINARY_DIR} cannot be embedded into regex
    directly. If they contain special regex metacharacters like +, the regex
    will break. So just escape such metacharacters with a backslash before
    embedding the path into the regex.
    
    The issue affected the following tests: CTestTestConfigFileInBuildDir1 and
    CTestTestConfigFileInBuildDir2.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index af1df22..654538e 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -16,6 +16,11 @@ MACRO(ADD_TEST_MACRO NAME COMMAND)
   LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
 ENDMACRO(ADD_TEST_MACRO)
 
+MACRO(REGEX_ESCAPE_STRING _OUT _IN)
+    # Escape special regex metacharacters with a backslash
+    string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}")
+ENDMACRO(REGEX_ESCAPE_STRING _OUT _IN)
+
 INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake)
 
 # Fake a user home directory to avoid polluting the real one.
@@ -1646,9 +1651,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log"
     )
+  REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_SOURCE_DIR "${CMake_SOURCE_DIR}")
   SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
     PASS_REGULAR_EXPRESSION
-      "Reading ctest configuration file: ${CMake_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake")
+      "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake")
 
   CONFIGURE_FILE(
     "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in"
@@ -1662,10 +1668,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log"
     )
+  REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_BINARY_DIR "${CMake_BINARY_DIR}")
   SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
     REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake
     PASS_REGULAR_EXPRESSION
-      "Reading ctest configuration file: ${CMake_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake")
+      "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake")
 
   # Use macro, not function so that build can still be driven by CMake 2.4.
   # After 2.6 is required, this could be a function without the extra 'set'

-----------------------------------------------------------------------

Summary of changes:
 Tests/CMakeLists.txt |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list