make/tests/scripts
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
..
features [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
functions Don't write $(shell ...) stdout to stderr on failure 2022-02-06 18:46:32 -05:00
misc tests: Allow run_make_test() to avoid passing -f 2022-02-27 17:47:42 -05:00
options * tests/scripts/options/dash-l: [SV 62172] Skip if not available 2022-04-24 10:39:32 -04:00
targets Remove extraneous characters from fatal() calls 2022-02-27 18:01:13 -05:00
variables [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
vms
test_template