summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-08-25 20:07:05 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-08-25 20:32:34 +0200
commit932d0f7b8a69bdcac5d945de600ce6be807aeff7 (patch)
treeb28def99ad24db522ee2bf51df9b9cf52d611b11 /tests
parent20de53b6a29fcfd2d91e815c5698b9b806a908f4 (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 'tests')
-rw-r--r--tests/Kpreprocess13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/Kpreprocess b/tests/Kpreprocess
index 73053fe..2ebf6e6 100644
--- a/tests/Kpreprocess
+++ b/tests/Kpreprocess
@@ -69,7 +69,7 @@ qaz = QAZ
echo = $(1)
config PRINT_ME
- string "$(ENV_VAR)" if ($(echo,FOO) && $(echo,BAR)) || !$(echo,BAZ) || !(($(qaz)))
+ string "$(ENV_1)" if ($(echo,FOO) && $(echo,BAR)) || !$(echo,BAZ) || !(($(qaz)))
default "$(echo,"foo")" if "foo $(echo,"bar") baz" = "$(undefined)"
@@ -128,3 +128,14 @@ error-n-res := $(error-if,n,oops)
# Causes an error when expanded
error-y-res = $(error-if,y,oops)
+
+
+# Environment variables (for testing Kconfig.env_vars). ENV_1 is already
+# referenced above.
+env_ref_1 := xxx $(ENV_2) xxx
+env_ref_2 := $(shell,echo $(ENV_3))
+env_ref_3 :=
+env_ref_3 += $(ENV_4)
+$(warning-if,$(ENV_5),$(ENV_UNDEFINED))
+source "$(ENV_6)"
+env_ref_4 = $(ENV_7) # Never evaluated