summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-03 21:49:28 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-03 21:51:34 (GMT)
commit47d197745a44b20ee65edd0e3223464a43b3ee55 (patch)
tree2b84ecabb1949a6378195cdf4b753381fcf64c8c /Tests
parent371235e0d7fad2881cb2067450d6aa7fadac1388 (diff)
downloadCMake-47d197745a44b20ee65edd0e3223464a43b3ee55.zip
CMake-47d197745a44b20ee65edd0e3223464a43b3ee55.tar.gz
CMake-47d197745a44b20ee65edd0e3223464a43b3ee55.tar.bz2
Tests: Simplify RunCMake.{if,while} unbalanced parenthesis cases
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt2
-rw-r--r--Tests/RunCMake/if/unbalanced-parenthesis.cmake11
-rw-r--r--Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt2
-rw-r--r--Tests/RunCMake/while/unbalanced-parenthesis.cmake12
4 files changed, 11 insertions, 16 deletions
diff --git a/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt b/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt
index 770ccb8..d2260a0 100644
--- a/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt
+++ b/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt
@@ -1,7 +1,7 @@
CMake Error at unbalanced-parenthesis\.cmake:[0-9]+ \(if\):
if given arguments:
- "NOT" "\(" "IN_LIST" "some_list"
+ "\("
mismatched parenthesis in condition
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/if/unbalanced-parenthesis.cmake b/Tests/RunCMake/if/unbalanced-parenthesis.cmake
index c51c755..45932f6 100644
--- a/Tests/RunCMake/if/unbalanced-parenthesis.cmake
+++ b/Tests/RunCMake/if/unbalanced-parenthesis.cmake
@@ -1,8 +1,5 @@
-set(var_with_paren "(")
-set(some_list "")
-
-if(NOT ${var_with_paren} IN_LIST some_list)
- message(STATUS "Never prints")
-else()
- message(STATUS "Never prints")
+set(paren "(")
+if(${paren})
+ message(STATUS "Condition incorrectly true")
endif()
+message(STATUS "Code incorrectly accepted")
diff --git a/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt b/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt
index 9d4132c..ffa4fda 100644
--- a/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt
+++ b/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt
@@ -1,7 +1,7 @@
CMake Error at unbalanced-parenthesis.cmake:[0-9]+ \(while\):
had incorrect arguments:
- "NOT" "\(" "IN_LIST" "some_list"
+ "\("
mismatched parenthesis in condition
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/while/unbalanced-parenthesis.cmake b/Tests/RunCMake/while/unbalanced-parenthesis.cmake
index 7a12701..15322e0 100644
--- a/Tests/RunCMake/while/unbalanced-parenthesis.cmake
+++ b/Tests/RunCMake/while/unbalanced-parenthesis.cmake
@@ -1,8 +1,6 @@
-set(var_with_paren "(")
-set(some_list "")
-
-while(NOT ${var_with_paren} IN_LIST some_list)
- message(STATUS "Never prints")
+set(paren "(")
+while(${paren})
+ message(STATUS "Condition incorrectly true")
+ break()
endwhile()
-
-message(STATUS "Never prints")
+message(STATUS "Code incorrectly accepted")