make/tests/scripts
Dmitry Goncharov a382ac6cd1 [SV 64803] Set origin for unmodified variables after -e
Ensure the origin of all variables inherited from the environment is
"environment override" if -e is given.  Previously only variables
that were set in the makefile had this origin.

PDS: Most of these changes are from Dmitry but I slightly modified
the algorithm: instead of rearranging the way in which MAKEFLAGS is
parsed we reset the env_override value to the default before we
re-parse MAKEFLAGS, then we set the origin of all env vars to the
correct value based on the new setting.

* NEWS: Mention the change for backward-compatibility.
* src/main.c (main): Ensure MAKEFLAGS is always marked special.
(reset_makeflags): Set env_overrides back to default before parsing
MAKEFLAGS.
(decode_switches): Call reset_env_override() to check for changes.
* src/variable.h (reset_env_override): Declare a new function.
* src/variable.c (reset_env_override): Go through all env variables
and ensure the origin is correct based on env_overrides.
(set_env_override): Helper function for the hash.
* tests/scripts/functions/foreach: Fix tests.
* tests/scripts/functions/let: Ditto.
* tests/scripts/functions/origin: Ditto.
* tests/scripts/options/dash-e: Add tests.
2024-02-04 11:34:49 -05:00
..
features [SV 65211] Fix load and loadapi tests. 2024-01-27 16:40:36 -05:00
functions [SV 64803] Set origin for unmodified variables after -e 2024-02-04 11:34:49 -05:00
misc tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
options [SV 64803] Set origin for unmodified variables after -e 2024-02-04 11:34:49 -05:00
targets * tests/scripts/targets/WAIT: Add whitespace to avoid W32 issues 2023-04-02 17:30:27 -04:00
variables Support conditional modifiers on all assignment operators 2024-01-28 14:20:47 -05:00
vms Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
test_template Update the test template. A few fixes in run_make_test(). 2004-09-22 04:36:17 +00:00