tests: Simplify customization of %ENV

Rather than having an %extraENV that is added to the default %ENV
and resetting %ENV _before_ each test, allow the test setup to
modify %ENV directly as needed then reset %ENV _after_ each test.

* tests/test_driver.pl: Remove unused %extraENV.
(resetENV): Don't add in %extraENV.
(_run_command): Reset after we run the command rather than before.
* tests/scripts/features/export: Convert %extraENV to %ENV
* tests/scripts/features/jobserver: Ditto
* tests/scripts/features/parallelism: Ditto
* tests/scripts/features/targetvars: Ditto
* tests/scripts/functions/eval: Ditto
* tests/scripts/functions/foreach: Ditto
* tests/scripts/functions/origin: Ditto
* tests/scripts/misc/general4: Ditto
* tests/scripts/options/dash-e: Ditto
* tests/scripts/targets/POSIX: Ditto
* tests/scripts/variables/GNUMAKEFLAGS: Ditto
* tests/scripts/variables/SHELL: Ditto
This commit is contained in:
Paul Smith
2020-04-01 01:58:33 -04:00
parent 289108cc9b
commit f79bde1a6d
13 changed files with 49 additions and 73 deletions

View File

@@ -94,7 +94,7 @@ all: ; $sname >/dev/null
# Don't use the general PATH if not found on the target path
$extraENV{PATH} = "$ENV{PATH}:sd";
$ENV{PATH} = "$ENV{PATH}:sd";
run_make_test(qq!
PATH := ..