summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
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}")