From 47d197745a44b20ee65edd0e3223464a43b3ee55 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 3 Mar 2022 16:49:28 -0500 Subject: Tests: Simplify RunCMake.{if,while} unbalanced parenthesis cases --- Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt | 2 +- Tests/RunCMake/if/unbalanced-parenthesis.cmake | 11 ++++------- Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt | 2 +- Tests/RunCMake/while/unbalanced-parenthesis.cmake | 12 +++++------- 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") -- cgit v0.12