Home | History | Annotate | Download | only in unit-tests
History log of /src/usr.bin/make/unit-tests/directive-export.mk
RevisionDateAuthorComments
 1.12  01-Jun-2024  rillig tests/make: require all expected messages to be listed in the .mk files
 1.11  01-Jun-2024  sjg make: add .export-all

An explicit syntax for exporting all global variables is much safer
than allowing .export with no argument to do the same.

Add .export-all and have .export with no argument throw a warning saying
to use .export-all

Reviewed by: rillig
 1.10  19-Nov-2023  rillig tests/make: test and explain exporting of variables
 1.9  20-Aug-2023  rillig tests/make: show a difference between 'export' and '.export'
 1.8  16-Feb-2021  rillig make: test exporting a variable that itself depends on a subprocess

When the point that "isn't going to end well" is reached, the stacktrace
is quite long but still reasonable:

main
main_ReadFiles
ReadAllMakefiles
ReadMakefile directive-export.mk
Parse_File
ParseLine # line 3 has: _!= :;:
ParseVarassign
Parse_DoVar
VarAssign_Eval
VarAssign_EvalShell # because of the '!='
Cmd_Exec :;:
Var_ReexportVars # before starting the subprocess
ExportVar EMPTY_SHELL
ExportVarEnv # was only marked for export
Var_Subst ${EMPTY_SHELL} # to get the value to export
VarSubstExpr ${EMPTY_SHELL}
Var_Parse ${EMPTY_SHELL}
Var_Subst ${:sh} # since EMPTY_SHELL= ${:sh}
VarSubstExpr ${:sh}
Var_Parse ${:sh}
ApplyModifiers
ApplySingleModifier :sh
ApplyModifier
ApplyModifier_SunShell :sh
Cmd_Exec "" # empty command
Var_ReexportVars
ExportVar EMPTY_SHELL
ExportVarEnv # skipping this edge case
 1.7  16-Feb-2021  rillig make: clarify what .export ${:U} means
 1.6  13-Dec-2020  rillig make(1): error out on misspelled directives

Before, make accepted misspellings like .warnings, .export-literally and
a few others, all of which are unlikely to occur in practice. See the
test directive-misspellings.mk for further details.
 1.5  12-Dec-2020  rillig make(1): extract ExportVars from Var_Export
 1.4  03-Nov-2020  rillig make(1): move tests from directives.mk to separate tests
 1.3  29-Oct-2020  rillig make(1): add test for .export and Var_Delete
 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