summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/while
Commit message (Collapse)AuthorAgeFilesLines
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2023-02-111-1/+1
| | | | | | | | For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
* while: diagnose errors during condition evaluationBrad King2022-03-0410-2/+34
| | | | | | Add a policy to diagnose condition errors in a compatible way. Fixes: #23296
* while: Restore tolerance of condition errorAlex Turbov2022-03-034-9/+2
| | | | | | | | | | | | | | | | | | | | | | Since commit 880ca66b51 (Fix: `while()` can silently ignore incorrect condition, 2021-08-09, v3.22.0-rc1~238^2~4) we correctly reject the code set(paren "(") while(${paren}) endwhile() However, rejecting it breaks compatibility with projects that used such code accidentally. In CMake 3.21 and below, any error in the condition was ignored because the `false` result exited the loop first. Restore tolerance of the error for now. A policy will be needed to make it an error later. Note that the same condition with `if` was always correctly rejected. Fixes: #22524 Issue: #23296 Co-authored-by: Brad King <brad.king@kitware.com>
* Tests: Simplify RunCMake.{if,while} unbalanced parenthesis casesBrad King2022-03-032-8/+6
|
* Fix: `while()` reports an error the same way as `if()`Alex Turbov2021-08-091-2/+5
| | | | With arguments list expanded.
* Fix: `while()` can silently ignore incorrect conditionAlex Turbov2021-08-093-1/+7
| | | | | When `conditionEvaluator.IsTrue(...)` returns `false` it just didn't print the error occured.
* Fix: Regression in the `cmConditionEvaluator::HandleLevel0`Alex Turbov2021-08-092-0/+10
| | | | | | | | As reported in the BUG #22524, mismatched parenthesis reported differently for `while()` and `if()`. The problem was in the double loop (over "handlers" and the arguments), where the outer loop didn't check the result of the running handler.
* cmListFileCache: Enforce proper nesting of flow control statementsKyle Edwards2020-10-225-17/+19
| | | | Fixes: #19153
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2020-06-181-1/+1
| | | | Use 3.3 or 2.8.12 where possible.
* Make error message of standalone endwhile command consistentDaniel Pfeifer2016-11-291-1/+1
| | | | with the error messages of endforeach, endmacro, endfunction, etc.
* cmListFileBacktrace: Refactor storage to provide efficient value semanticsBrad King2016-04-182-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.4.0-rc1~321^2~2 (Genex: Store a backtrace, not a pointer to one, 2015-07-08) we treat cmListFileBacktrace instances as lightweight values. This was true at the time only because the backtrace information was kept in the cmState snapshot hierarchy. However, that forced us to accumulate a lot of otherwise short-lived snapshots just to have the backtrace fields available for reference by cmListFileBacktrace instances. Recent refactoring made backtrace instances independent of the snapshot hierarchy to avoid accumulating short-lived snapshots. This came at the cost of making backtrace values heavy again, leading to lots of string coying and slower execution. Fix this by refactoring cmListFileBacktrace to provide value semantics with efficient shared storage underneath. Teach cmMakefile to maintain its call stack using an instance of cmListFileBacktrace. This approach allows the current backtrace to be efficiently saved whenever it is needed. Also teach cmListFileBacktrace the notion of a file-level scope. This is useful for messages about the whole file (e.g. during parsing) that are not specific to any line within it. Push the CMakeLists.txt scope for each directory and never pop it. This ensures that we always have some context information and simplifies cmMakefile::IssueMessage. Push/pop a file-level scope as each included file is processed. This supersedes cmParseFileScope and improves diagnostic message context information in a few places. Fix the corresponding test cases to expect the improved output.
* Tests: Move command failure cases into RunCMake infrastructureBrad King2015-07-1416-0/+53
Move failure cases from the CMake.{If,List,While,GetProperty} tests over to the RunCMake.{if,list,while,get_property} tests to use the more modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to try to regex-match full paths.