Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/varname-dot-shell.exp
RevisionDateAuthorComments
 1.23  11-Jan-2025  rillig make: replace "Malformed conditional" with "Variable is undefined"

Evaluating a conditional such as ".if ${UNDEF}" produced a "Malformed
conditional" error, even though the form of the conditional was correct,
it was the content of the variable that was wrong.

Replace this message with the more accurate "Variable is undefined",
revealing which of the possibly many variables is actually undefined.
 1.22  31-Oct-2024  rillig make: in the debug log, always qualify line number with filename

Previously, to find out the filename corresponding to a line number from
a 'Parsing' line, it was necessary to find the preceding
'SetFilenameVars' line, which was unnecessarily time-consuming and
distracting.

The 'filename:line' format matches the one used in PrintStackTrace, and
it differs from the one used in PrintLocation, as the former format is
more common in other tools.

Most of the affected unit tests only use the 'Parsing' lines to give
additional context to their debug log, so no structural changes there.
 1.21  14-Apr-2024  rillig branches: 1.21.2;
make: add debug logging for .if and .for lines in -dp mode

This helps track down in which line a condition is evaluated.
 1.20  20-Dec-2023  rillig make: use consistent debug messages style when ignoring variables

When a variable is not modified or not deleted, clearly say so and state
the reason. Use the same style of debug messages everywhere, putting
the word 'ignoring' at the front. Previously, that word sticked out to
the right, but only in some cases.
 1.19  20-Dec-2023  rillig make: fix confusing debug logging when deleting a variable

Be clear when deleting a variable is ignored and state the reason,
instead of only providing a keyword as a hint for insiders.
 1.18  10-Dec-2023  rillig make: explain in the debug log why a variable assignment is ignored
 1.17  09-Dec-2023  sjg make: Var_SetWithFlags set fromCmd for SCOPE_CMDLINE

Set fromCmd true for SCOPE_CMDLINE
regardless of the variable name.

Reviewed by: rillig
 1.16  26-Mar-2022  rillig make: avoid trailing whitespace in debug log for variables

Since trailing whitespace is invisible, describe the variable value in
words to make it visible.
 1.15  26-Mar-2022  rillig make: add space after colon in debug logging for variables

These log messages are intended for human interpretation, so don't make
them unnecessarily hard to read.
 1.14  03-Mar-2022  rillig make: make debug logging for comparisons less technical
 1.13  28-Dec-2021  rillig make: make debug logging a bit more human-friendly

The previous log format "ParseReadLine (%d): '%s'" focused on the
implementation, it was not immediately obvious to a casual reader that
the number in parentheses was the line number. Additionally, having
both a colon and quotes in a log message is uncommon. The quotes have
been added in parse.c 1.127 from 2007-01-01.

The new log format "Parsing line %d: %s" is meant to be easier readable
by humans. The quotes are not needed since ParseReadLine always strips
trailing whitespace, leaving no room for ambiguities. The other log
messages follow common punctuation rules, which makes the beginning of
the line equally unambiguous. Before var.c 1.911 from 2021-04-05,
variable assignments were logged with the format "%s:%s = %s", without a
space after the colon.
 1.12  05-Apr-2021  rillig make: in debug log, add space between scope and variable name

Without this space, the debug log looked more like line noise, even
though the only punctuation was a single innocent ':'. From a make
user's perspective, the variable name is a word of its own and should
not be visually glued to its namespace.
 1.11  04-Apr-2021  rillig make: remove filler word 'Do' from function names for parsing

No functional change, except for debug logging.
 1.10  15-Mar-2021  rillig make: change debug log for variable evaluation flags to lowercase

This makes them easier distinguishable from variable names since the
latter are usually uppercase.

No functional change outside debug mode.
 1.9  28-Dec-2020  rillig make(1): replace global preserveUndefined with VARE_KEEP_UNDEF

Controlling the expansion of variable expressions using a global
variable and a VARE flag was inconsistent.

Converting the global variable into a flag had to prerequisites:

1. The unintended duplicate variable assignment had to be fixed, as
done in parse.c 1.520 from 2020-12-27. Without this fix, it would have
been necessary to add more flags to Var_Exists and Var_SetWithFlags, and
this would have become too complex.

2. There had to be a unit test demonstrating that VARE_KEEP_DOLLAR only
applies to the top-level expression and is not passed to the
subexpressions, while VARE_KEEP_UNDEF applies to all subexpressions as
well. This test is in var-op-expand.mk 1.10 from 2020-12-28, at least
for the ':@word@' modifier. In ParseModifierPartSubst, VARE_KEEP_UNDEF
is not passed down either, in the same way.
 1.8  08-Nov-2020  rillig make(1): rename VARE_ASSIGN to VARE_KEEP_DOLLAR

The other flags in VarEvalFlags already describe their effects, not the
place where they are used. It's more important to know the effect.

Only a single unit test had to be adjusted. This probably means that
there are too few tests where the special effects of VARE_KEEP_DOLLAR
come into play. It could also mean that the effects are so simple and
obvious that they don't need any debug log, but that's not the case.
 1.7  30-Oct-2020  rillig make(1): prevent appending to read-only variables
 1.6  30-Oct-2020  rillig make(1): demonstrate how to append to a read-only variable
 1.5  30-Oct-2020  rillig make(1): move test flags for varname-dot-shell to the test itself
 1.4  22-Sep-2020  rillig make(1): move VAR_JUNK and VAR_KEEP away from VarFlags

These two flags have nothing to do with a variable. They are only used
while evaluating a variable expression.

While here, rename the flags and make their documentation more precise.
 1.3  13-Sep-2020  rillig make(1): shorten debug output of ApplyModifiers

Having the words "eflags" and "vflags" in the debug output was too
repetitive. That they are flags is made obvious by the '|' separator,
and the flags have clearly distinguishable names (VARE_* vs. VAR_*),
which lowers the chance for confusion.
 1.2  23-Aug-2020  rillig make(1): fix assertion failure in debug output for read-only variables
 1.1  23-Aug-2020  rillig make(1): add test for the newly added .SHELL variable
 1.21.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed