Tests: Simplify RunCMake.{if,while} unbalanced parenthesis cases

This commit is contained in:
Brad King
2022-03-03 16:49:28 -05:00
parent 371235e0d7
commit 47d197745a
4 changed files with 11 additions and 16 deletions
@@ -1,7 +1,7 @@
CMake Error at unbalanced-parenthesis\.cmake:[0-9]+ \(if\): CMake Error at unbalanced-parenthesis\.cmake:[0-9]+ \(if\):
if given arguments: if given arguments:
"NOT" "\(" "IN_LIST" "some_list" "\("
mismatched parenthesis in condition mismatched parenthesis in condition
Call Stack \(most recent call first\): Call Stack \(most recent call first\):
@@ -1,8 +1,5 @@
set(var_with_paren "(") set(paren "(")
set(some_list "") if(${paren})
message(STATUS "Condition incorrectly true")
if(NOT ${var_with_paren} IN_LIST some_list)
message(STATUS "Never prints")
else()
message(STATUS "Never prints")
endif() endif()
message(STATUS "Code incorrectly accepted")
@@ -1,7 +1,7 @@
CMake Error at unbalanced-parenthesis.cmake:[0-9]+ \(while\): CMake Error at unbalanced-parenthesis.cmake:[0-9]+ \(while\):
had incorrect arguments: had incorrect arguments:
"NOT" "\(" "IN_LIST" "some_list" "\("
mismatched parenthesis in condition mismatched parenthesis in condition
Call Stack \(most recent call first\): Call Stack \(most recent call first\):
@@ -1,8 +1,6 @@
set(var_with_paren "(") set(paren "(")
set(some_list "") while(${paren})
message(STATUS "Condition incorrectly true")
while(NOT ${var_with_paren} IN_LIST some_list) break()
message(STATUS "Never prints")
endwhile() endwhile()
message(STATUS "Code incorrectly accepted")
message(STATUS "Never prints")