Test foreach/function/macro handling of bracket arguments

Bracket arguments recorded in command invocations inside foreach,
function, and macro blocks should not have any replacements done when
the arguments are replayed later.  Teach the RunCMake.Syntax test to
cover these cases.
This commit is contained in:
Brad King 2013-10-30 19:12:59 -04:00
parent ccdf7e04d4
commit b54dbebf62
7 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,2 @@
^\${x}:a
\${x}:b$

View File

@ -0,0 +1,3 @@
foreach(x a b)
message([[${x}:]] "${x}")
endforeach()

View File

@ -0,0 +1,2 @@
^\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:a,n,2,a;n,a,n,
\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:b,n,2,b;n,b,n,$

View File

@ -0,0 +1,6 @@
function(fun x)
message([[${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}:]]
"${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}")
endfunction(fun)
fun(a n)
fun(b n)

View File

@ -0,0 +1,2 @@
^\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:a,n,2,a;n,a,n,
\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:b,n,2,b;n,b,n,$

View File

@ -0,0 +1,6 @@
macro(mac x)
message([[${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}:]]
"${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}")
endmacro(mac)
mac(a n)
mac(b n)

View File

@ -12,6 +12,9 @@ run_cmake(CommandComments)
run_cmake(CommandError0)
run_cmake(CommandError1)
run_cmake(CommandError2)
run_cmake(ForEachBracket1)
run_cmake(FunctionBracket1)
run_cmake(MacroBracket1)
run_cmake(String0)
run_cmake(String1)
run_cmake(StringBackslash)