diff options
author | Brad King <brad.king@kitware.com> | 2022-03-04 13:53:09 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-03-04 13:53:16 (GMT) |
commit | d7febfc72722c3d304e31b8de6bed837e115616f (patch) | |
tree | 6fe76d8e00e9210fe65da79d0a76fa4cc97c79c2 /Tests | |
parent | 71a8b4e63dd8c80b1c09c665c81a510835174828 (diff) | |
parent | da2361ffb35799319abca6f7c3138c916685fb2d (diff) | |
download | CMake-d7febfc72722c3d304e31b8de6bed837e115616f.zip CMake-d7febfc72722c3d304e31b8de6bed837e115616f.tar.gz CMake-d7febfc72722c3d304e31b8de6bed837e115616f.tar.bz2 |
Merge topic 'while-bug-compatibility' into release-3.23
da2361ffb3 while: Restore tolerance of condition error
47d197745a Tests: Simplify RunCMake.{if,while} unbalanced parenthesis cases
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7041
Diffstat (limited to 'Tests')
6 files changed, 12 insertions, 24 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-result.txt b/Tests/RunCMake/while/unbalanced-parenthesis-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/while/unbalanced-parenthesis-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt b/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt deleted file mode 100644 index 9d4132c..0000000 --- a/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt +++ /dev/null @@ -1,8 +0,0 @@ -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\): - CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/while/unbalanced-parenthesis-stdout.txt b/Tests/RunCMake/while/unbalanced-parenthesis-stdout.txt new file mode 100644 index 0000000..d45e194 --- /dev/null +++ b/Tests/RunCMake/while/unbalanced-parenthesis-stdout.txt @@ -0,0 +1 @@ +-- Code incorrectly accepted diff --git a/Tests/RunCMake/while/unbalanced-parenthesis.cmake b/Tests/RunCMake/while/unbalanced-parenthesis.cmake index 7a12701..39d736b 100644 --- a/Tests/RunCMake/while/unbalanced-parenthesis.cmake +++ b/Tests/RunCMake/while/unbalanced-parenthesis.cmake @@ -1,8 +1,7 @@ -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") +# FIXME(#23296): The above condition error is tolerated for compatibility. +message(STATUS "Code incorrectly accepted") |