Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/directive-for.exp
RevisionDateAuthorComments
 1.31  01-Jul-2025  rillig tests/make: require "expect" comments to start a line

Lua's string.gmatch function doesn't allow the anchor "^"; but its
string.gsub function does.
 1.30  28-Jun-2025  rillig make: consistently use double quotes in error messages

Previously, some error messages used single quotes, very few used
backticks or parentheses, most already used double quotes.

While here, reword a few error messages to be clearer or more consistent
with related error messages.
 1.29  30-Mar-2025  rillig make: if there is an error in the items of a .for loop, don't iterate
 1.28  30-Mar-2025  rillig make: use '"filename" line 123' for locations instead of 'filename:123'

The format 'filename:123' is commonly used for identifying a location in
a file. Text editors recognize it and allow quick navigation through it.
The previous format was specific to make and would have required custom
support in editors.

The new format was already used in stack traces, except for the first
line. Now all lines use the same format.
 1.27  29-Mar-2025  rillig make: add ":" to error message about unknown modifier

In the manual page, the modifiers are listed with a preceding ":", so
use the same pattern in the error message. This removes an inconsistency
between the error messages "Unknown modifier" and "Bad modifier".
 1.26  29-Aug-2024  rillig make: reduce line length in error messages

The error messages for deeply nested parse errors were hard to decipher,
due to the large amount of text. Split these messages into individual
lines, just as in the backtrace for .include files and .for loops. This
unified backtrace makes the output more uniform.
 1.25  06-Jul-2024  rillig tests/make: clean up tests

Prefer "expect+X" directives to be above the code generating them,
instead of "expect-X" directives below the code.

In varmod-edge.mk, separate the tests, as the common loop does not pull
its weight.
 1.24  05-Jul-2024  rillig make: in error messages for anonymous variables, log the value
 1.23  04-Jul-2024  rillig make: add more context information to error messages

In case of a parse error or evaluation error, print the variable value
in addition to the variable name, to see the effects of previous
expression modifiers.

In nested make calls, print the current directory at the bottom of a
stack trace, as that information is otherwise hard to get in a parallel
build spanning multiple directories.
 1.22  20-Apr-2024  rillig branches: 1.22.2;
make: provide more context information for parse/evaluate errors
 1.21  06-Dec-2023  rillig tests/make: show how global variables are unaffected by .for loops
 1.20  19-Oct-2023  rillig tests/make: clean up, explain and reorganize several tests
 1.19  01-Jun-2023  rillig tests/make: force line-based diagnostics to be listed in the tests

This way, contradictions between the intended output and the actual
output are closer together and have a better chance of being spotted.
 1.18  01-Jun-2023  rillig make: add more details to debug logging of .for loops
 1.17  10-May-2023  rillig tests/make: clean up tests for .for loops

Most of the tests from forloop.mk were already in directive-for.mk.
 1.16  09-May-2023  rillig make: skip syntactically wrong .for loops

When a .for loop cannot be interpreted correctly, for example when there
are no iteration variables or the number of words doesn't match the
iteration variables, skip the body of the .for loop instead of
interpreting it once.
 1.15  08-May-2023  rillig make: disallow characters like '$' in variable names in .for loops

Fixes PR 53146.
 1.14  08-May-2023  rillig tests/make: add more tests for unusual variable names in .for loops
 1.13  08-May-2023  rillig make: fix parsing of unusual line continuations in .for loops
 1.12  08-Jan-2022  rillig make: fix reported line numbers of continuation lines (since 2002)

Previously, multi-line directives like '.info' or '.error' reported the
line number of their last line instead of their first line, which is
more usual. This also affected the debug log from '-dp'.
 1.11  08-Jan-2022  rillig tests/make: demonstrate edge case in parsing .for loops
 1.10  02-Jan-2022  rillig tests/make: test edge cases in .for loops
 1.9  23-Feb-2021  rillig make: improve error message for unknown modifier

Back in 1995, the modifiers were all single-character, and it made sense
to print only the first character. Nowadays, with ':S', ':@var@...@',
'::=' and several others, a little more context is useful to see where
the exact error is. The actual modifier is still guessed, and the guess
may be wrong as soon as backslashes get involved, but it is still better
than before.
 1.8  27-Dec-2020  rillig make(1): add test for missing error handling in .for loop
 1.7  15-Nov-2020  rillig make(1): update and add comments in tests

As a result of the new comments, some line numbers have changed in the
output of the tests. No other changes.
 1.6  25-Oct-2020  rillig make(1): test funny character in .for variable names
 1.5  25-Oct-2020  rillig make(1): add test for escaping parentheses and braces in .for loops
 1.4  22-Sep-2020  rillig make(1): remove obsolete fix for PR bin/29985
 1.3  22-Sep-2020  rillig make(1): add test for .for loop from PR bin/29985
 1.2  14-Sep-2020  rillig make(1): add test for nested .for loops with the same variable name
 1.1  02-Sep-2020  rillig make(1): add test for the .for directive

For a long time, I had assumed that the iteration variables of a .for
loop are just normal global variables. This assumption was wrong but
didn't have any consequences.

The iteration variables of a .for loop can just be accessed like global
variables, therefore it is not obvious that they are implemented in a
completely different way.

There are some edge cases in conditions used inside .for loops, in which
the iteration variables cannot be used like normal variables. An
example is brought up in https://gnats.netbsd.org/47888, which observes
that the defined() and empty() functions in conditions only work with
variables but ignore the iteration "variables", simply because these are
not variables but only expressions.
 1.22.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed