Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/varmisc.exp
RevisionDateAuthorComments
 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  29-Mar-2025  rillig make: in stack traces from target commands, add the command level

A target can contain several commands, and these commands are likely to
contain the same expressions. To distinguish them, add one more line to
the stack trace, to narrow down the source of the error.
 1.25  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.24  20-Jul-2024  rillig make: don't run erroneous commands in compat mode

When there is a parse or evaluation error in an expression that becomes
part of the command, don't run that command, as the result of the failed
evaluation typically contains garbage characters. Skip the remaining
commands from that target as well, as they may depend on the erroneous
command.
 1.23  09-Jul-2024  rillig make: error out on parse/evaluation errors in shell commands

The expression ${VAR:X} has an unknown modifier ':X'. Previously, this
expression errored out when the expression was evaluated at parse time,
but not when the expression was evaluated when generating the commands
to bring a target up to date. The errors were previously reported, they
didn't affect the exit status, though.

Now, errors in expressions are handled in the same way, regardless of
the time at which they are evaluated.
 1.22  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.21  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.20  20-Apr-2024  rillig 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-Oct-2023  rillig tests/make: clean up, explain and reorganize several tests
 1.17  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.16  31-Aug-2020  sjg Add test case for FLAGS dependent on .TARGET
 1.15  30-Jul-2020  rillig make(1): add test for indirect unclosed variable

The error message mentions only the original variable name right now.
It's left to the Makefile author to see where the actual unclosed
variable value comes from. From a usability standpoint that's not
optimal, but everything else would need additional cycles even in the
good cases, or it might have side-effects when evaluating a variable
twice (once to detect the error, and a second time to find out the
details of the error).
 1.14  28-Jul-2020  rillig make(1): issue a parse error on unclosed variables

These errors had not been detected before by make.
In pkgsrc, this task as been done by pkglint since 2019-04-07.
 1.13  26-Jul-2020  rillig make(1): add coverage test for dynamic = TRUE in Var_Parse
 1.12  26-Jul-2020  rillig make(1): add test for unclosed variables
 1.11  26-Jul-2020  rillig make(1): add test for expanding dynamic variables
 1.10  26-Jul-2020  rillig make(1): add test for appending and exporting a variable
 1.9  26-Jul-2020  rillig make(1): add test for .MAKE.SAVE_DOLLARS
 1.8  01-Jul-2020  sjg Fix parsing of nested variables during .for loop

Recent change to cond.c to avoid eval of unnecessary
terms had side effect on constructs like:

.for s in 1 2
.if defined(MAN$s) && !empty(MAN$s)
MAN+= ${MAN$s}
.endif
.endfor

resulting in MAN being flagged as recursive.

When Var_Parse encounters a variable within a variable name
we want to force it to be expanded.
But given the way get_mpt_arg calls Var_Parse we need to check
whether we actually started parsing a variable yet.
 1.7  31-Jan-2017  sjg Add check to cmpv test to ensure that target specific vars with
modifiers work as expected.
 1.6  30-Jan-2017  sjg Add :range and :_

:range replaces var value with an integer sequence one per word
in the current var value.

:_ stores the current var value in $_ so that it can be referred to
later in the modifier series.

Reviewed by: christos
 1.5  14-Jan-2017  sjg branches: 1.5.2;
Allow providing a utc value to :{gm,local}time

Reviewed by: christos
 1.4  12-Oct-2015  sjg branches: 1.4.2;
Add unit-test for discarded :?
 1.3  11-Oct-2015  sjg Avoid echo -n in unit-tests
 1.2  11-Oct-2015  sjg Add Boolean wantit to Var_Parse and Var_Subst

wantit will be FALSE when we are just consuming to discard
in which case we skip "expensive" things like Cmd_Exec.

Reviewed by: christos
 1.1  21-Aug-2014  apb Add varmisc.mk, for miscellaneous variable tests.

For now, the only test is copied from
src/tests/usr.bin/make/d_unmatchedvarparen.mk. This was
the only test in src/tests/usr.bin/make that was not also in
src/usr.bin/make/unit-tests.

XXX: src/tests/usr.bin/mk should be changed to reach over to
src/usr.bin/make/unit-tests, instead of keeping out of date copies
of the tests.
 1.4.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.5.2.1  21-Apr-2017  bouyer Sync with HEAD

RSS XML Feed