doc: twister: ztest: Add test application diagram

Add a diagram to illustrate a test application's project
components with relationships between Ztest and Twister
objects.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This commit is contained in:
Dmitrii Golovanov 2024-06-23 16:14:05 +02:00 committed by Anas Nashif
commit 5d763534d6
3 changed files with 32 additions and 13 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 131 KiB

View file

@ -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 configuration file may contain one or more entries in the tests section each
identifying a test scenario. 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 Test application configurations are written using the YAML syntax and share the
same structure as samples. same structure as samples.

View file

@ -215,25 +215,31 @@ function can be written as follows:
Quick start - Integration testing Quick start - Integration testing
********************************* *********************************
A simple working base is located at :zephyr_file:`samples/subsys/testsuite/integration`. Just A simple working base is located at :zephyr_file:`samples/subsys/testsuite/integration`.
copy the files to ``tests/`` and edit them for your needs. The test will then To make a test application for the **bar** component of **foo**, you should copy the
be automatically built and run by the twister script. If you are testing sample folder to ``tests/foo/bar`` and edit files there adjusting for your test
the **bar** component of **foo**, you should copy the sample folder to application's purposes.
``tests/foo/bar``. It can then be tested with:
.. 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
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.
To run all test scenarios defined in a test application, run:
.. code-block:: console .. code-block:: console
./scripts/twister -T tests/foo/bar/ ./scripts/twister -T tests/foo/bar/
To select just one of the test scenarios, run Twister with ``--scenario`` command:
.. code-block:: console
./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: The sample contains the following files:
CMakeLists.txt CMakeLists.txt