summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-01-07 18:28:26 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-01-07 18:28:26 (GMT)
commitf7fbe0f6811dcd656f8cf772c6d57199c92f0a5e (patch)
tree39231d868b7775fea08762429439dec83ee7d0d0 /Tests
parent5c6cbd390e1d2466df318d2f25e563eb3418bce3 (diff)
parentba39d7e9d04b6a8d3d9bccdf07b69cd2d959a083 (diff)
downloadCMake-f7fbe0f6811dcd656f8cf772c6d57199c92f0a5e.zip
CMake-f7fbe0f6811dcd656f8cf772c6d57199c92f0a5e.tar.gz
CMake-f7fbe0f6811dcd656f8cf772c6d57199c92f0a5e.tar.bz2
Merge topic 'xcode-escape-backslash'
ba39d7e9 Xcode: Escape all backslashes in strings (#15328)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake7
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake3
3 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index acc0075..395c74b 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
run_cmake(XcodeFileType)
run_cmake(XcodeAttributeGenex)
run_cmake(XcodeAttributeGenexError)
+run_cmake(XcodeObjectNeedsEscape)
run_cmake(XcodeObjectNeedsQuote)
run_cmake(XcodeOptimizationFlags)
run_cmake(XcodePreserveNonOptimizationFlags)
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake
new file mode 100644
index 0000000..c34e3fe
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake
@@ -0,0 +1,7 @@
+set(expect "-DKDESRCDIR=\\\\\\\\\\\\\"foo\\\\\\\\\\\\\"")
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeObjectNeedsEscape.xcodeproj/project.pbxproj actual
+ REGEX "OTHER_CPLUSPLUSFLAGS = [^;]*;" LIMIT_COUNT 1)
+if(NOT "${actual}" MATCHES "${expect}")
+ message(SEND_ERROR "The actual project contains the line:\n ${actual}\n"
+ "which does not match expected regex:\n ${expect}\n")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake
new file mode 100644
index 0000000..7606a19
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+string(APPEND CMAKE_CXX_FLAGS " -DKDESRCDIR=\\\"foo\\\"")
+add_library(foo STATIC foo.cpp)