make/tests/scripts/options
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
..
dash-B Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
dash-C Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
dash-d * src/main.c (decode_debug_flags): [SV 607777] Preserve -d options 2021-09-06 20:36:15 -04:00
dash-e [SV 64803] Set origin for unmodified variables after -e 2024-02-04 11:34:49 -05:00
dash-f * tests/scripts/features/reinvoke: Warn about closing STDIN. 2023-01-11 20:35:11 -05:00
dash-I tests [WINDOWS32]: Support Strawberry Perl on Windows 2022-12-20 02:14:18 -05:00
dash-k tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
dash-l * tests/scripts/options/dash-l: Simplify the test via the helper 2023-02-26 13:46:02 -05:00
dash-n * tests/run_make_test.pl: Fix support for valgrind. 2019-09-21 15:13:24 -04:00
dash-q [SV 47151] Exit with 1 when checking recursive make -q 2016-02-29 01:33:50 -05:00
dash-r [SV 64107] Disable builtins immediately on -R or -r 2023-04-30 09:40:50 -04:00
dash-s [SV 63537] Document and test flippable switches 2022-12-18 20:06:38 -05:00
dash-t
dash-W Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
eval Add test suite support to Windows 2017-06-04 18:37:20 -04:00
general Add test suite support to Windows 2017-06-04 18:37:20 -04:00
print-directory Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
print-targets [SV 64571] Add --print-targets option 2024-01-08 23:31:58 -05:00
shuffle Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
symlinks tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
warn [SV 64115] Suppress warnings about undefined GNUMAKEFLAGS 2023-04-30 09:40:50 -04:00