From: michael.opdenacker@bootlin.com
To: docs@lists.yoctoproject.org
Cc: Michael Opdenacker <michael.opdenacker@bootlin.com>
Subject: [PATCH 4/6] test-manual: add links to python unittest
Date: Wed, 6 Dec 2023 16:54:25 +0100 [thread overview]
Message-ID: <20231206155427.279612-5-michael.opdenacker@bootlin.com> (raw)
In-Reply-To: <20231206155427.279612-1-michael.opdenacker@bootlin.com>
From: Michael Opdenacker <michael.opdenacker@bootlin.com>
Better than using "python unittest" without any
special formatting.
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
---
documentation/test-manual/intro.rst | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/documentation/test-manual/intro.rst b/documentation/test-manual/intro.rst
index e72a51172c..a2560f4f53 100644
--- a/documentation/test-manual/intro.rst
+++ b/documentation/test-manual/intro.rst
@@ -205,8 +205,8 @@ Tests map into the codebase as follows:
$ bitbake-selftest bb.tests.data.DataExpansions.test_one_var
- The tests are based on `Python
- unittest <https://docs.python.org/3/library/unittest.html>`__.
+ The tests are based on
+ `Python unittest <https://docs.python.org/3/library/unittest.html>`__.
- *oe-selftest:*
@@ -219,7 +219,8 @@ Tests map into the codebase as follows:
in the same thread. To parallelize large numbers of tests you can
split the class into multiple units.
- - The tests are based on Python unittest.
+ - The tests are based on
+ `Python unittest <https://docs.python.org/3/library/unittest.html>`__.
- The code for the tests resides in
``meta/lib/oeqa/selftest/cases/``.
@@ -338,21 +339,24 @@ A simple test example from ``lib/bb/tests/data.py`` is::
val = self.d.expand("${foo}")
self.assertEqual(str(val), "value_of_foo")
-In this example, a ``DataExpansions`` class of tests is created,
-derived from standard Python unittest. The class has a common ``setUp``
-function which is shared by all the tests in the class. A simple test is
-then added to test that when a variable is expanded, the correct value
-is found.
+In this example, a ``DataExpansions`` class of tests is created, derived from
+standard `Python unittest <https://docs.python.org/3/library/unittest.html>`__.
+The class has a common ``setUp`` function which is shared by all the tests in
+the class. A simple test is then added to test that when a variable is
+expanded, the correct value is found.
-BitBake selftests are straightforward Python unittest. Refer to the
-Python unittest documentation for additional information on writing
-these tests at: https://docs.python.org/3/library/unittest.html.
+BitBake selftests are straightforward
+`Python unittest <https://docs.python.org/3/library/unittest.html>`__.
+Refer to the `Python unittest documentation
+<https://docs.python.org/3/library/unittest.html>`__ for additional information
+on writing such tests.
``oe-selftest``
---------------
These tests are more complex due to the setup required behind the scenes
-for full builds. Rather than directly using Python's unittest, the code
+for full builds. Rather than directly using `Python unittest
+<https://docs.python.org/3/library/unittest.html>`__, the code
wraps most of the standard objects. The tests can be simple, such as
testing a command from within the OE build environment using the
following example::
--
2.34.1
next prev parent reply other threads:[~2023-12-06 15:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 15:54 [PATCH 0/6] test-manual: misc updates and improvements michael.opdenacker
2023-12-06 15:54 ` [PATCH 1/6] test-manual: text and formatting fixes michael.opdenacker
2023-12-06 15:54 ` [PATCH 2/6] test-manual: resource updates michael.opdenacker
2023-12-06 15:54 ` [PATCH 3/6] test-manual: use working example michael.opdenacker
2023-12-06 15:54 ` michael.opdenacker [this message]
2023-12-06 15:54 ` [PATCH 5/6] test-manual: explicit or fix file paths michael.opdenacker
2023-12-06 15:54 ` [PATCH 6/6] test-manual: add or improve hyperlinks michael.opdenacker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231206155427.279612-5-michael.opdenacker@bootlin.com \
--to=michael.opdenacker@bootlin.com \
--cc=docs@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox