summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-04-30 19:58:45 (GMT)
committerBrad King <brad.king@kitware.com>2008-04-30 19:58:45 (GMT)
commit16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a (patch)
tree468ed480667295bd18694cabe05b70af42d37601 /Tests
parent637596a157bba8a18ee51ca0c7dc27df278c8596 (diff)
downloadCMake-16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a.zip
CMake-16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a.tar.gz
CMake-16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a.tar.bz2
BUG: Fix escaping of more characters on Windows shells.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CustomCommand/CMakeLists.txt34
1 files changed, 21 insertions, 13 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 4660e5d..7e9f29c 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -207,14 +207,12 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c
##############################################################################
# Test non-trivial command line arguments in custom commands.
SET(EXPECTED_ARGUMENTS)
-# TODO: Check shell operators < > << >> | 2>&1 1>&2 &> ! &
SET(CHECK_ARGS
c:/posix/path
c:\\windows\\path
'single-quotes'
single'quote
\"double-quotes\"
- double\"quote
"\\;semi-colons\\;"
"semi\\;colon"
`back-ticks`
@@ -225,15 +223,15 @@ SET(CHECK_ARGS
{curly}
{lcurly}
rcurly}
- #<angle> # angle-brackets are inconsistent on windows right now
- #<langle
- #rangle>
+ <angle>
+ <langle
+ rangle>
[square]
[lsquare # these have funny behavior due to special cases for
rsquare] # windows registry value names in list expansion
$dollar-signs$
dollar$sign
- &ampersands&
+ &ampersands&x # Borland make does not like trailing ampersand
one&ampersand
@two-ats@
one@at
@@ -268,7 +266,6 @@ SET(CHECK_ARGS
"'single quotes with space'"
"single'quote with space"
"\"double-quotes with space\""
- "double\"quote with space"
"\\;semi-colons w s\\;"
"semi\\;colon w s"
"`back-ticks` w s"
@@ -279,9 +276,9 @@ SET(CHECK_ARGS
"{curly} w s"
"{lcurly w s"
"rcurly} w s"
- #"<angle> w s" # angle-brackets are inconsistent on windows right now
- #"<langle w s"
- #"rangle> w s"
+ "<angle> w s"
+ "<langle w s"
+ "rangle> w s"
"[square] w s"
"[lsquare w s" # these have funny behavior due to special cases for
"rsquare] w s" # windows registry value names in list expansion
@@ -316,15 +313,26 @@ SET(CHECK_ARGS
"#two-pounds# w s"
"one#pound w s"
~ ` ! @ \# $ % ^ & _ - + = : "\;" \" ' , . ? "(" ")" { } []
-# | < > << >> &> 2>&1 1>&2
-# \\ # Need to test last to avoid ; escape in list.
-# # Make tools need help when this is the last argument.
)
IF(NOT MINGW)
# * # MinGW programs on windows always expands the wildcard!
# / # MSys make converts a leading slash to the mingw home directory
LIST(APPEND CHECK_ARGS * /)
ENDIF(NOT MINGW)
+
+# The windows command shell does not support a double quote by itself:
+# double\"quote
+# without messing up quoting of arguments following it.
+
+# Make tools need help with escaping a single backslash
+# \
+# at the end of a command because they think it is a continuation
+# character.
+
+# We now have special cases for shell operators:
+# | < > << >> &> 2>&1 1>&2
+# to allow custom commands to perform redirection.
+
FOREACH(arg ${CHECK_ARGS})
SET(ARG "${arg}")
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}")