Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/directive-for.mk
RevisionDateAuthorComments
 1.32  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.31  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.30  30-Mar-2025  rillig make: if there is an error in the items of a .for loop, don't iterate
 1.29  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.28  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.27  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.26  05-Jul-2024  rillig make: in error messages for anonymous variables, log the value
 1.25  20-Apr-2024  rillig branches: 1.25.2;
make: provide more context information for parse/evaluate errors
 1.24  06-Dec-2023  rillig tests/make: show how global variables are unaffected by .for loops
 1.23  19-Oct-2023  rillig tests/make: clean up, explain and reorganize several tests
 1.22  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.21  01-Jun-2023  rillig tests/make: clean up comments, extend a few tests
 1.20  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.19  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.18  08-May-2023  rillig make: disallow characters like '$' in variable names in .for loops

Fixes PR 53146.
 1.17  08-May-2023  rillig tests/make: add more tests for unusual variable names in .for loops
 1.16  08-May-2023  rillig make: fix parsing of unusual line continuations in .for loops
 1.15  01-Oct-2022  rillig tests/make: make comment in test for .for easier to understand
 1.14  23-Aug-2022  rillig tests/make: demonstrate that .for variables take precedence
 1.13  15-Jan-2022  rillig tests/make: ensure that the 'expect' comments in tests are correct

Based on tests/usr.bin/xlint/check-expect.lua.

For now, this extra check needs to be run manually.
 1.12  08-Jan-2022  rillig tests/make: demonstrate edge case in parsing .for loops
 1.11  02-Jan-2022  rillig tests/make: test edge cases in .for loops
 1.10  27-Dec-2020  rillig make(1): add test for missing error handling in .for loop
 1.9  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.8  25-Oct-2020  rillig make(1): test funny character in .for variable names
 1.7  25-Oct-2020  rillig make(1): add test for escaping parentheses and braces in .for loops
 1.6  24-Oct-2020  rillig make(1): use consistent indentation in variable assignments

Initial work by "pkglint -F *.mk", manually adjusted in a few places.
 1.5  22-Sep-2020  rillig make(1): remove obsolete fix for PR bin/29985
 1.4  22-Sep-2020  rillig make(1): add test for .for loop from PR bin/29985
 1.3  14-Sep-2020  rillig make(1): add test for nested .for loops with the same variable name
 1.2  02-Sep-2020  rillig make(1): fix wrong comments in test for the .for loop

These comments were my original assumptions, which I wrote before
running the test and before looking at the implementation.
 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.25.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed