summaryrefslogtreecommitdiff
path: root/test/py/tests/test_kconfig.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-08-10 17:49:20 -0400
committerTom Rini <trini@konsulko.com>2022-08-10 17:49:20 -0400
commitcdebee1fd9fa04cc4c972f826bae19b28c253eb0 (patch)
tree97a13d6a54ea8cb825d19cd65d4c9480ffd327dc /test/py/tests/test_kconfig.py
parent3dd4e916324efc825a7ee8e412f5cf1ded839021 (diff)
parent468091a4602f78aaa11d41190ae66d8b240e144a (diff)
Merge branch '2022-08-10-assorted-updates'
- An assortment of bugfixes and minor updates
Diffstat (limited to 'test/py/tests/test_kconfig.py')
-rw-r--r--test/py/tests/test_kconfig.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/py/tests/test_kconfig.py b/test/py/tests/test_kconfig.py
new file mode 100644
index 00000000000..0b9e6bc3bd1
--- /dev/null
+++ b/test/py/tests/test_kconfig.py
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright 2022 Google LLC
+# Written by Simon Glass <sjg@chromium.org>
+
+import pytest
+
+import u_boot_utils as util
+
+# This is needed for Azure, since the default '..' directory is not writeable
+TMPDIR = '/tmp/test_kconfig'
+
+@pytest.mark.slow
+@pytest.mark.boardspec('sandbox')
+def test_kconfig(u_boot_console):
+ """Test build failures when IF_ENABLED_INT() option is not enabled"""
+ cons = u_boot_console
+
+ # This detects build errors in test/lib/kconfig.c
+ out = util.run_and_log(
+ cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox',
+ '-a', 'TEST_KCONFIG', '-o', TMPDIR], ignore_errors=True)
+ assert 'invalid_use_of_IF_ENABLED_INT' in out
+ assert 'invalid_use_of_CONFIG_IF_ENABLED_INT' in out
+
+@pytest.mark.slow
+@pytest.mark.boardspec('sandbox_spl')
+def test_kconfig_spl(u_boot_console):
+ """Test build failures when IF_ENABLED_INT() option is not enabled"""
+ cons = u_boot_console
+
+ # This detects build errors in test/lib/kconfig_spl.c
+ out = util.run_and_log(
+ cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox_spl',
+ '-a', 'TEST_KCONFIG', '-o', TMPDIR], ignore_errors=True)
+ assert 'invalid_use_of_IF_ENABLED_INT' in out
+
+ # There is no CONFIG_SPL_TEST_KCONFIG, so the CONFIG_IF_ENABLED_INT()
+ # line should not generate an error
+ assert 'invalid_use_of_CONFIG_IF_ENABLED_INT' not in out