From 2bac578c5abae233cc855f79791a2846c9a99518 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 3 May 2025 15:31:54 +0200 Subject: test: allow multiple config options in buildconfigspec In some cases we have alternative configuration options that supply the same functionality, e.g CONFIG_NET and CONFIG_NET_LWIP. Allow to specify all of them as arguments for buildconfigspec() and execute the text if any of these is fulfilled, e.g. @pytest.mark.buildconfigspec('net', 'net_lwip') Update the documentation. Signed-off-by: Heinrich Schuchardt Acked-by: Jerome Forissier Reviewed-by: Simon Glass --- test/py/conftest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/py/conftest.py') diff --git a/test/py/conftest.py b/test/py/conftest.py index 5aea85647af..6c3ac67979a 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -711,9 +711,13 @@ def setup_buildconfigspec(item): """ for options in item.iter_markers('buildconfigspec'): - option = options.args[0] - if not ubconfig.buildconfig.get('config_' + option.lower(), None): - pytest.skip('.config feature "%s" not enabled' % option.lower()) + nomatch = True + for arg in options.args: + if ubconfig.buildconfig.get('config_' + arg.lower(), None): + nomatch = False + if nomatch: + argsString = ', '.join(options.args) + pytest.skip(f'.config features "{argsString}" not enabled') for options in item.iter_markers('notbuildconfigspec'): option = options.args[0] if ubconfig.buildconfig.get('config_' + option.lower(), None): -- cgit v1.2.3