Commit Graph

11 Commits

Author SHA1 Message Date
Heinrich Schuchardt
2bac578c5a 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>
2025-05-18 09:16:51 +02:00
Tom Rini
4fde49c317 doc: pytest: Use globing for test files
After the original series was merged, Quentin noted that we could handle
adding additional tests more easily by using the glob feature. Do so.

Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-05-18 08:51:51 +02:00
Tom Rini
02e5d344a0 doc: pytest: Document the test_button test
Add this test to the documentation. No changes to the test itself were
required.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:57 +02:00
Tom Rini
e1076c6619 doc: pytest: Document the test_bootmenu test
Add this test to the documentation. There was already a function comment
that included the argument, so convert it to the right style to be
rendered correctly in output.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:57 +02:00
Tom Rini
4964cc9caa doc: pytest: Document the test_bind test
Add this test to the documentation. None of the functions had comments,
so attempt to explain what each does.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00
Tom Rini
6c3c08c478 doc: pytest: Document the test_efi_loader test
Add this test to the documentation. We need to add a code-block
annotation to the example and indent it correctly. We also need to
document the do_test_efi_helloworld_net function and that in turn means
changing the documentation to test_efi_helloworld_net_http and
test_efi_helloworld_net_tftp to reflect what is and isn't done in those
functions themselves now.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00
Tom Rini
58b2f0895b doc: pytest: Document the test_bootstage test
Add this test to the documentation. We need to move the import to follow
the main comment so that it renders correctly, and add a code-block
annotation to the example and indent it correctly. Next, neither of the
functions had comments themselves, so document them now.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00
Tom Rini
45d325ba09 doc: pytest: Document the test_net test
Add this test to the documentation. While the diff appears large at
first, the only changes within the test are to move the imports to
follow the pydoc comment and then to code-block and indent the example
configuration.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00
Tom Rini
8f8f0f0ed9 doc: pytest: Document the test_net_boot test
Add the test_net_boot.py test to the generated documentation. While most
of this was already commented correctly for inclusion the biggest
problem was examples of code without a code-block notation. This in turn
broke parsing. Add the missing notations. We also must have the comment
prior to any import lines or it will not be seen as a comment on the
overall file and thus not included.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00
Tom Rini
a865d1d254 doc: pytest: Framework for documenting tests and document test_000_version
In order to easily document pytests, we need to include the autodoc
extension. We also need to make sure that for building the docs, CI
includes pytest and that we have PYTHONPATH configured such that it will
find all of the tests and related files. Finally, we need to have our
comments in the test file by in proper pydoc format in order to be
included in the output.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00
Tom Rini
be2bdfd019 doc: Start improving our pytest documentation
Begin the work of documenting all of our pytests. To do this, we should
have a directory under develop for it as there will be a large number of
new files. As the current document is referenced externally in a number
of locations, add the sphinx_reredirects module so that we can redirect
from the old location to the new.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-11 12:52:56 +02:00