diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-25 20:07:05 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-25 20:32:34 +0200 |
| commit | 932d0f7b8a69bdcac5d945de600ce6be807aeff7 (patch) | |
| tree | b28def99ad24db522ee2bf51df9b9cf52d611b11 /testsuite.py | |
| parent | 20de53b6a29fcfd2d91e815c5698b9b806a908f4 (diff) | |
Add a Kconfig.env_vars attribute that lists env. variables
Kconfig.env_vars is a set() with the names of all environment variables
referenced in the configuration.
Can be used e.g. for custom incremental build implementations, though
sync_deps() already indirectly catches any relevant changes to
environment variables.
Diffstat (limited to 'testsuite.py')
| -rw-r--r-- | testsuite.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/testsuite.py b/testsuite.py index 4faed1f..e22c775 100644 --- a/testsuite.py +++ b/testsuite.py @@ -2344,7 +2344,13 @@ config J print("Testing preprocessor") - os.environ["ENV_VAR"] = "env" + os.environ["ENV_1"] = "env_1" + os.environ["ENV_2"] = "env_2" + os.environ["ENV_3"] = "env_3" + os.environ["ENV_4"] = "env_4" + os.environ["ENV_5"] = "n" + os.environ["ENV_6"] = "Kconfiglib/tests/empty" + os.environ["ENV_7"] = "env_7" # We verify warnings manually c = Kconfig("Kconfiglib/tests/Kpreprocess", warn_to_stderr=False) @@ -2392,7 +2398,7 @@ config J verify_str(c.syms["PRINT_ME"], r""" config PRINT_ME string - prompt "env" if (FOO && BAR) || !BAZ || !QAZ + prompt "env_1" if (FOO && BAR) || !BAZ || !QAZ default "\"foo\"" if "foo \"bar\" baz" = "" """) @@ -2439,6 +2445,10 @@ config PRINT_ME else: fail("expanding error-y-res didn't raise an exception") + # Check Kconfig.env_vars + verify_equal(c.env_vars, + set(("ENV_1", "ENV_2", "ENV_3", "ENV_4", "ENV_5", "ENV_6"))) + # Check that the expected warnings were generated verify_equal(c.warnings, [ "Kconfiglib/tests/Kpreprocess:116: warning: 'echo message on stderr >&2' wrote to stderr: message on stderr", |
