diff options
| author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-05-03 15:31:54 +0200 |
|---|---|---|
| committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-05-18 09:16:51 +0200 |
| commit | 2bac578c5abae233cc855f79791a2846c9a99518 (patch) | |
| tree | 362b4f513d7502f61b89a20bfe44863544c9b4fc /doc/develop/pytest | |
| parent | 4fde49c317e1dc396b3dbf8e74757f5c18f60f1a (diff) | |
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 <heinrich.schuchardt@canonical.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc/develop/pytest')
| -rw-r--r-- | doc/develop/pytest/usage.rst | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/develop/pytest/usage.rst b/doc/develop/pytest/usage.rst index 49d269d66a7..779b2dbe24b 100644 --- a/doc/develop/pytest/usage.rst +++ b/doc/develop/pytest/usage.rst @@ -522,3 +522,27 @@ of the `ubman.config` object, for example Build configuration values (from `.config`) may be accessed via the dictionary `ubman.config.buildconfig`, with keys equal to the Kconfig variable names. + +A required configuration setting can be defined via a buildconfigspec() +annotation. The name of the configuration option is specified in lower case. The +following annotation for a test requires CONFIG_EFI_LOADER=y: + +.. code-block:: python + + @pytest.mark.buildconfigspec('efi_loader') + +Sometimes multiple configuration option supply the same functionality. If +multiple arguments are passed to buildconfigspec(), only one of the +configuration options needs to be set. The following annotation requires that +either of CONFIG_NET or CONFIG_NET_LWIP is set: + +.. code-block:: python + + @pytest.mark.buildconfigspec('net', 'net lwip') + +The notbuildconfigspec() annotation can be used to require a configuration +option not to be set. The following annotation requires CONFIG_RISCV=n: + +.. code-block:: python + + @pytest.mark.notbuildconfigspec('riscv') |
