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:
parent
ccdf7e04d4
commit
b54dbebf62
|
@ -0,0 +1,2 @@
|
|||
^\${x}:a
|
||||
\${x}:b$
|
|
@ -0,0 +1,3 @@
|
|||
foreach(x a b)
|
||||
message([[${x}:]] "${x}")
|
||||
endforeach()
|
|
@ -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,$
|
|
@ -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)
|
|
@ -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,$
|
|
@ -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)
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue