make/tests/scripts/variables
Dmitry Goncharov 8c2aa889bb [SV 62324] Simplify set_file_variables by passing in the stem
Previously we always used the file->stem value as our stem in
set_file_variables(); when that wasn't correct we had to temporarily
set that value while the function was called, then reset it afterward.
This led to issues (for example when we assumed the stem was a cached
string but it wasn't).

Avoid this by passing in the stem as an argument so that different
values can be provided.

Add tests to verify this.

* src/commands.c (set_file_variables): Take second parameter stem to
relieve the callers of set_file_variables() from setting/restoring
file->stem.
* src/commands.h (set_file_variables): Ditto.
(execute_file_commands): Pass file->stem to set_file_variables().
* src/file.c (expand_deps): Pass d->stem to set_file_variables() and
remove set and restore of file->stem.
* src/implicit.c (pattern_search): Pass stem to set_file_variables()
and remove set and restore of file->stem.
* tests/scripts/features/se_explicit: Add new tests.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/se_statpat: Ditto.
* tests/scripts/variables/automatic: Ditto.
2022-04-24 10:39:32 -04:00
..
automatic [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
CURDIR Refresh the test suite framework implementation. 2019-09-16 08:25:33 -04:00
DEFAULT_GOAL Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
define Add support for the POSIX :::= assignment operator. 2021-09-20 00:29:31 -04:00
EXTRA_PREREQS Support the .EXTRA_PREREQS special variable 2020-01-03 02:08:59 -05:00
flavors Add support for the POSIX :::= assignment operator. 2021-09-20 00:29:31 -04:00
GNUMAKEFLAGS [SV 59169] Add --debug=why and --debug=print options 2020-12-05 16:25:12 -05:00
INCLUDE_DIRS [SV 45211] Parse MAKEFLAGS immediately when it's reset 2021-09-05 21:08:59 -04:00
LIBPATTERNS Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
MAKE Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
MAKE_RESTARTS * tests/scripts/variables/MAKE_RESTARTS: Remove TAB chars 2022-02-27 18:01:13 -05:00
MAKECMDGOALS * A few script fixes and updates for 3.78. 1999-09-17 03:15:37 +00:00
MAKEFILES Add test suite support to Windows 2017-06-04 18:37:20 -04:00
MAKEFLAGS [SV 45211] Parse MAKEFLAGS immediately when it's reset 2021-09-05 21:08:59 -04:00
MAKELEVEL Fix for bug #1276: Handle SHELL according to POSIX requirements. 2004-11-28 23:11:23 +00:00
MFILE_LIST [SV 50823] Support filenames containing '$' in MAKEFILE_LIST 2017-06-04 18:37:21 -04:00
negative Add support for the POSIX :::= assignment operator. 2021-09-20 00:29:31 -04:00
private cosmetics: fix few innocuous typos 2013-05-05 20:50:37 -04:00
SHELL Support "unexport" in target-specific variables. 2020-11-29 17:57:33 -05:00
special * job.c (child_error): Combine file info with error message. 2016-03-20 14:23:22 -04:00
undefine [SV 59870] define/undefine prerequisites are not target-specific vars 2021-03-14 16:35:38 -04:00