Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/varmod.mk
RevisionDateAuthorComments
 1.30  29-Jun-2025  rillig make: if a condition is erroneous, skip the whole .if/.endif
 1.29  29-Jun-2025  rillig make: fix parsing of modifier parts for :gmtime and :localtime

There's no practical use for escaping the ":" or "}" in these two
modifiers, but the same scheme may prove useful for the :M and :N
modifiers, which are currently parsed in a completely different manner,
thus adding needless complexity.

Parsing of the :M and :N modifiers is discussed in PR bin/46139.
 1.28  29-Jun-2025  rillig tests/make: demonstrate bug in parsing :gmtime and :localtime

When the parsing of modifiers was unified a bit in May 2024, the :gmtime
and :localtime modifiers were the only ones that had two different
delimiters. Of these delimiters, only the second one can be escaped, but
the intention was that both of them can be escaped.

Since it doesn't make sense to have either ":" or "}" or ")" in a
second-based timestamp, this bug has survived more than a year.
 1.27  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.26  30-Mar-2025  rillig make: fix error message for invalid ":[...]" modifier

The unparsed value of the modifier argument can already be seen in the
stack trace, but the modifier argument may contain expressions and the
expanded value of these expressions was hidden up to now. See the EMPTY
test at the bottom of varmod-select-words.mk for details.
 1.25  30-Mar-2025  rillig make: let the ":t" modifiers fall back to the ":from=to" modifier

Suggested by https://bugs.freebsd.org/285726.

This means that the ":t" modifiers cannot have future extensions that
include a "=", as that may break existing code.
 1.24  29-Mar-2025  rillig make: let unknown ":O" modifiers fall back to the ":from=to" modifier

Inspired by https://bugs.freebsd.org/285726, which concerns the ":t"
modifier instead.

This means that future extensions to the ":O" modifier must not contain
a "=" anywhere, otherwise they may break existing code.
 1.23  29-Mar-2025  rillig tests/make: fix the documented modifier table

The SysV column was largely incorrect or too unspecific, stating N/A
when "no" was actually correct.

The modifiers differ in whether they fall back to the ":from=to"
modifier. The suggestion in https://bugs.freebsd.org/285726 to make more
of the modifiers fall back to the ":from=to" modifier thus becomes
nonobvious to decide.
 1.22  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.21  11-Jan-2025  rillig tests/make: force correct order of expected messages
 1.20  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.19  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.18  05-Jul-2024  rillig make: in error messages for anonymous variables, log the value
 1.17  04-Jul-2024  rillig make: error out on the "Bad modifier" error message

Previously, the "Bad modifier" error message did not affect make's exit
status. As a side effect, this kind of error now gets more context
information.
 1.16  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.15  06-Jun-2024  rillig tests/make: test unescaped '$' at the end of a modifier part

In ParseModifierPart, an unescaped '$' that occurs right before a
delimiter is handled differently from a '$' that occurs in the middle of
the modifier part.

In practice, this edge case is only used by the first part of the
':C,from,to,' modifier. Using it in most other modifier parts produces
an error message.
 1.14  05-Jun-2024  rillig make: sync comments with reality
 1.13  02-Jun-2024  rillig make: fix out-of-bounds read when parsing indirect modifiers
 1.12  01-Jun-2024  rillig tests/make: test more modifiers and special variables
 1.11  20-Apr-2024  rillig make: provide more context information for parse/evaluate errors
 1.10  03-Feb-2024  sjg make: state of save_dollars affects what is a parse error

When save_dollars is false it is not a parse error to
encounter $$ rather than \$.
 1.9  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.8  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.7  24-Aug-2022  rillig tests/make: test misleading error messages on unclosed expressions

The error messages say 'Unknown modifier' or 'Bad modifier', which is
not entirely correct. The modifier in itself is valid, it's just that
make doesn't expect the end of the string after the modifier.
 1.6  06-Aug-2022  rillig tests/make: document parsing behavior of modifiers

The table was created by manually inspecting the code of the various
ApplyModifier functions in var.c.

The modifiers are listed in alphabetical order, except for the SysV
modifier, which is listed at the end since it is used as a fallback
modifier for many other modifiers and because it does not have a fixed
prefix.
 1.5  19-Dec-2020  rillig make(1): fix error message for .info/.warning/.error without argument

Previously, the error message was "Unknown directive", which was
obviously wrong. The new error message is "Missing argument".
 1.4  02-Nov-2020  rillig make(1): add test for the :P modifier, which does not fall back
 1.3  13-Sep-2020  rillig make(1): in lint mode, complain about erroneous $$

Since 2008-12-21, make has silently ignored strange variable names in
constructs like '$$', '$}', '$' followed by nothing. Ignoring these
bugs in makefiles instead of reporting them is not a good idea.

To improve the situation, make complains about these errors now, but
only in lint mode (-dL). This preserves existing behavior while still
allowing to validate existing makefiles that they don't depend on this
bug.

If the test phase goes well, these error messages may be enabled
unconditionally.

https://mail-index.netbsd.org/pkgsrc-users/2020/09/12/msg032229.html
 1.2  16-Aug-2020  rillig make(1): describe the purpose of each newly added unit test dummy
 1.1  16-Aug-2020  rillig make(1): add dummies for fine-grained tests, one per single feature

The test names have been derived from the current manual page.

All these tests are dummies right now, and the code from the existing
tests will be moved into the new tests step by step.

This is done to prevent modmisc, escape, varmod-edge and varmisc from
growing without any bounds, and to reduce the side-effects of one test
to the others.

RSS XML Feed