summaryrefslogtreecommitdiff
path: root/test/lib/Kconfig
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2022-08-01 07:57:59 -0600
committerTom Rini <[email protected]>2022-08-10 13:38:30 -0400
commit29784d62eded89332254307bdb63ad8a7d8249d2 (patch)
treedec2e9893799a112503202ba10c871dc68bb1aad /test/lib/Kconfig
parent5e2548c1d6e0331edbf94edcfc95d55b5e9a6cab (diff)
test: Add some tests for kconfig.h
The macros in this file are a little confusing and we currently have no tests to check that they work as expected. Add some tests which check the macros in C code. Add a few tests which check that the build errors are generated correctly too, using buildman's -a option. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test/lib/Kconfig')
-rw-r--r--test/lib/Kconfig23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lib/Kconfig b/test/lib/Kconfig
new file mode 100644
index 00000000000..dbb03e4a36f
--- /dev/null
+++ b/test/lib/Kconfig
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright 2022 Google LLC
+
+if SANDBOX
+
+config TEST_KCONFIG
+ bool "Enable detection of Kconfig macro errors"
+ help
+ This is used to test that the IF_ENABLED_INT() macro causes a build error
+ if the value is used when the CONFIG Is not enabled.
+
+config TEST_KCONFIG_ENABLE
+ bool "Option to enable"
+ help
+ This is the option that controls whether the value is present.
+
+config TEST_KCONFIG_VALUE
+ int "Value associated with the option"
+ depends on TEST_KCONFIG_ENABLE
+ help
+ This is the value whgch is present if TEST_KCONFIG_ENABLE is enabled.
+
+endif # SANDBOX