diff options
author | Brad King <brad.king@kitware.com> | 2021-08-18 14:49:03 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-08-18 10:49:16 -0400 |
commit | 1f3dceea578aa80859cb9fc7a3e095cc09cd8563 (patch) | |
tree | b04d4e0d28615ea623a6f5dcd0f71010a73d9373 /Tests | |
parent | 881e76e7c51c2aa8958252c4bc1166a8b00f24a7 (diff) | |
parent | eae125ace54bd82ed5be14cfee50f41a07b10619 (diff) | |
download | cmake-1f3dceea578aa80859cb9fc7a3e095cc09cd8563.tar.gz |
Merge topic 'while-regression'
eae125ace5 Refactor: Get rid of `isTrue` variable in the `while` block execution
4c1cdfd8f0 Refactor: Keep `cmWhileFunctionBlocker` members private
d22f68d019 Refactor: Transform `while` loop into `for`
e97e714f0d Fix: `while()` reports an error the same way as `if()`
880ca66b51 Fix: `while()` can silently ignore incorrect condition
61b33c3f4e Fix: Regression in the `cmConditionEvaluator::HandleLevel0`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6442
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/if/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/if/unbalanced-parenthesis-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/if/unbalanced-parenthesis.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/while/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/while/unbalanced-parenthesis-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/while/unbalanced-parenthesis.cmake | 8 |
8 files changed, 38 insertions, 0 deletions
diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake index 239c167139..6baa840592 100644 --- a/Tests/RunCMake/if/RunCMakeTest.cmake +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -9,6 +9,8 @@ run_cmake(duplicate-else-after-elseif) run_cmake(elseif-message) run_cmake(misplaced-elseif) +run_cmake(unbalanced-parenthesis) + run_cmake(MatchesSelf) run_cmake(IncompleteMatches) run_cmake(IncompleteMatchesFail) diff --git a/Tests/RunCMake/if/unbalanced-parenthesis-result.txt b/Tests/RunCMake/if/unbalanced-parenthesis-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/if/unbalanced-parenthesis-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt b/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt new file mode 100644 index 0000000000..770ccb8f18 --- /dev/null +++ b/Tests/RunCMake/if/unbalanced-parenthesis-stderr.txt @@ -0,0 +1,8 @@ +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\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/if/unbalanced-parenthesis.cmake b/Tests/RunCMake/if/unbalanced-parenthesis.cmake new file mode 100644 index 0000000000..c51c7557f8 --- /dev/null +++ b/Tests/RunCMake/if/unbalanced-parenthesis.cmake @@ -0,0 +1,8 @@ +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") +endif() diff --git a/Tests/RunCMake/while/RunCMakeTest.cmake b/Tests/RunCMake/while/RunCMakeTest.cmake index 7da80ace30..bb9b991014 100644 --- a/Tests/RunCMake/while/RunCMakeTest.cmake +++ b/Tests/RunCMake/while/RunCMakeTest.cmake @@ -5,3 +5,5 @@ run_cmake(EndMissing) run_cmake(EndMismatch) run_cmake(EndAlone) run_cmake(EndAloneArgs) + +run_cmake(unbalanced-parenthesis) diff --git a/Tests/RunCMake/while/unbalanced-parenthesis-result.txt b/Tests/RunCMake/while/unbalanced-parenthesis-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/while/unbalanced-parenthesis-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt b/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt new file mode 100644 index 0000000000..9d4132c5a3 --- /dev/null +++ b/Tests/RunCMake/while/unbalanced-parenthesis-stderr.txt @@ -0,0 +1,8 @@ +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.cmake b/Tests/RunCMake/while/unbalanced-parenthesis.cmake new file mode 100644 index 0000000000..7a12701e6c --- /dev/null +++ b/Tests/RunCMake/while/unbalanced-parenthesis.cmake @@ -0,0 +1,8 @@ +set(var_with_paren "(") +set(some_list "") + +while(NOT ${var_with_paren} IN_LIST some_list) + message(STATUS "Never prints") +endwhile() + +message(STATUS "Never prints") |