Commit Graph

8 Commits

Author SHA1 Message Date
Alex Turbov
e97e714f0d Fix: while() reports an error the same way as if()
With arguments list expanded.
2021-08-09 22:35:11 +03:00
Alex Turbov
880ca66b51 Fix: while() can silently ignore incorrect condition
When `conditionEvaluator.IsTrue(...)` returns `false` it just
didn't print the error occured.
2021-08-09 22:35:11 +03:00
Alex Turbov
61b33c3f4e Fix: Regression in the cmConditionEvaluator::HandleLevel0
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.
2021-08-09 21:05:09 +03:00
Kyle Edwards
12f6e37eb7 cmListFileCache: Enforce proper nesting of flow control statements
Fixes: #19153
2020-10-22 11:40:48 -04:00
Brad King
9b99b4bfc8 Tests/RunCMake: Update cmake_minimum_required versions
Use 3.3 or 2.8.12 where possible.
2020-06-18 09:52:05 -04:00
Daniel Pfeifer
1afbe7d2cc Make error message of standalone endwhile command consistent
with the error messages of endforeach, endmacro, endfunction, etc.
2016-11-29 13:53:29 -05:00
Brad King
7c36d2067b cmListFileBacktrace: Refactor storage to provide efficient value semantics
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.
2016-04-18 09:21:19 -04:00
Brad King
e5ca59b456 Tests: Move command failure cases into RunCMake infrastructure
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.
2015-07-14 10:25:38 -04:00