Skip to content

Commit

Permalink
doc: twister: ztest: Add test application diagram
Browse files Browse the repository at this point in the history
Add a diagram to illustrate a test application's project
components with relationships between Ztest and Twister
objects.

Signed-off-by: Dmitrii Golovanov <[email protected]>
  • Loading branch information
golowanow authored and nashif committed Jul 10, 2024
1 parent b826805 commit 5d76353
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
4 changes: 4 additions & 0 deletions doc/develop/test/figures/twister_test_project.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions doc/develop/test/twister.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ files in the application's project directory. This test application
configuration file may contain one or more entries in the tests section each
identifying a test scenario.

.. _twister_test_project_diagram:

.. figure:: figures/twister_test_project.svg
:alt: Twister and a Test applications' project.
:figclass: align-center

Twister and a Test applications' project.


Test application configurations are written using the YAML syntax and share the
same structure as samples.

Expand Down
28 changes: 17 additions & 11 deletions doc/develop/test/ztest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,24 +215,30 @@ function can be written as follows:
Quick start - Integration testing
*********************************

A simple working base is located at :zephyr_file:`samples/subsys/testsuite/integration`. Just
copy the files to ``tests/`` and edit them for your needs. The test will then
be automatically built and run by the twister script. If you are testing
the **bar** component of **foo**, you should copy the sample folder to
``tests/foo/bar``. It can then be tested with:
A simple working base is located at :zephyr_file:`samples/subsys/testsuite/integration`.
To make a test application for the **bar** component of **foo**, you should copy the
sample folder to ``tests/foo/bar`` and edit files there adjusting for your test
application's purposes.

.. code-block:: console
To build and execute all applicable test scenarios defined in your test application
use the :ref:`Twister <twister_script>` tool, for example:

./scripts/twister -s tests/foo/bar/test-identifier
.. code-block:: console
In the example above ``tests/foo/bar`` signifies the path to the test and the
``test-identifier`` references a test scenario defined in the :file:`testcase.yaml` file.
./scripts/twister -T tests/foo/bar/
To run all test scenarios defined in a test application, run:
To select just one of the test scenarios, run Twister with ``--scenario`` command:

.. code-block:: console
./scripts/twister -T tests/foo/bar/
./scripts/twister --scenario tests/foo/bar/your.test.scenario.name
In the command line above ``tests/foo/bar`` is the path to your test application and
``your.test.scenario.name`` references a test scenario defined in :file:`testcase.yaml`
file, which is like ``sample.testing.ztest`` in the boilerplate test suite sample.

See :ref:`Twister test project diagram <twister_test_project_diagram>` for more details
on how Twister deals with Ztest application.

The sample contains the following files:

Expand Down

0 comments on commit 5d76353

Please sign in to comment.