Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/varmod-edge.mk
RevisionDateAuthorComments
 1.37  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.36  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.35  29-Mar-2025  rillig make: stop parsing after seeing an unknown modifier in an expression

Previously, after an expression such as ${VAR:Z::::}, make detected the
unknown modifier ":Z" and then continued parsing, which produced
unnecessary follow-up error messages. It was also necessary to
distinguish the error cases when logging the result of an applied
modifier in -dv mode.

Unify the error handling cases of a syntax error, an evaluation error
and an unknown modifier, to avoid the unnecessary follow-up error
messages.

The test in varmod-edge.mk now produces ":}" from the erroneous
expression, which may be misleading and thus will be looked at in a
follow-up commit.

The general idea of this patch was reviewed by sjg, I made a few
nonsubstantial changes after the review.
 1.34  29-Mar-2025  rillig make: add more details to error message about unfinished modifier

These details allow to quickly see the place where the syntax error is,
based on the surrounding lines from the stack trace.
 1.33  11-Jan-2025  rillig make: omit redundant follow-up message "Malformed conditional"

If there is a parse error or an evaluation error during the conditional,
the conditional is already mentioned in the "while evaluating condition"
line, so there's no reason to repeat it once again.

Same for the "Bad condition" message from the '?:' modifier.
 1.32  11-Jan-2025  rillig tests/make: force correct order of expected messages
 1.31  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.30  06-Aug-2024  rillig make: in error message about conditionals, use single quotes

Single quotes are used less often in the conditionals themselves, which
leads to fewer confusions.
 1.29  09-Jul-2024  rillig make: error out on syntax errors in ':M' and ':N' modifiers

More than a year ago, the warning has been added. Now it has been
promoted to an error.
 1.28  06-Jul-2024  rillig tests/make: sync a comment with reality
 1.27  06-Jul-2024  rillig make: error out on a matching malformed matching pattern '[['
 1.26  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.25  05-Jul-2024  rillig make: in error messages for anonymous variables, log the value
 1.24  05-Jul-2024  rillig make: error out on unclosed expressions during parse time

In exchange, this adds location information.

For unnamed expressions, the value is no longer printed. This will be
added back in a follow-up commit.
 1.23  05-Jul-2024  rillig tests/make: add expected messages for "Unclosed expression"
 1.22  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.21  30-Jun-2024  rillig make: error out on some more syntax errors

Previously, these errors only produced a message on stderr. They only
affected make's exit status when they were evaluated at parse time, but
not when evaluating the commands for a specific target right before
executing them.

The affected syntax errors are:
* invalid regular expressions in the ':C' modifier
* out-of-range references to regex groups in the ':C' modifier
* unfinished modifiers
 1.20  20-Apr-2024  rillig branches: 1.20.2;
make: provide more context information for parse/evaluate errors
 1.19  19-Nov-2023  rillig make: replace 'variable expression' with 'expression' in diagnostics
 1.18  19-Nov-2023  rillig tests/make: replace 'variable expression' with 'expression'

Each expression is based on a variable, there's no need for the
verbosity. The wording in make's diagnostics will be changed in a
follow-up commit.
 1.17  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.16  23-Feb-2021  rillig make: improve error message for unclosed modifier

Replace "variable specification" with the more modern "variable
expression", reduce the number of parentheses, output more than a single
character for modifiers, make it obvious that in expressions such as
${:Serror}, the "" means a variable name.
 1.15  23-Feb-2021  rillig make: add quotes around variable name in an error message
 1.14  22-Feb-2021  rillig make: add test for confusing double space in error message
 1.13  24-Oct-2020  rillig make(1): indent directives like .info, .if, .for consistently

Done by "pkglint -F *.mk", no manual corrections.
 1.12  08-Aug-2020  rillig make(1): fixup for "Unfinished modifier"
 1.11  01-Aug-2020  rillig make(1): improve output grouping in varmod-edge test

The generated error messages are now closer to the test cases that
produce them. To keep the expected output stable, the line numbers are
omitted from the .info directives.
 1.10  01-Aug-2020  rillig make(1): add test for ${VAR::::}

It's a bit unrealistic, but at least there are good diagnostics.
 1.9  01-Aug-2020  rillig make(1): add test for empty modifier list after colon

This is a good candidate for becoming an error in strict mode.
Either write ${VAR} or write ${VAR:modifiers}, but not half-baked.
 1.8  19-Jul-2020  rillig make(1): rename VarGetPattern to ParseModifierPart
 1.7  27-Apr-2020  christos Adjust test for the new behavior: % on hls and no % on the rhs does not
prepend the lhs to the rhs.
 1.6  02-Dec-2019  rillig branches: 1.6.4;
Add more tests for variable modifiers in make.
 1.5  01-Dec-2019  rillig Fix out-of-bounds read in Str_Match.
 1.4  30-Nov-2019  rillig Demonstrate some more edge cases for the :M modifier
 1.3  30-Nov-2019  rillig Fix unit test for edge case in :M modifier
 1.2  30-Nov-2019  rillig Add another unit test for the :M modifier
 1.1  30-Nov-2019  rillig Add unit tests for variable modifiers like :M and :N
 1.6.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.6.4.1  02-Dec-2019  martin file varmod-edge.mk was added on branch phil-wifi on 2020-04-08 14:09:17 +0000
 1.20.2.1  01-Jul-2024  perseant Sync with HEAD.

RSS XML Feed