twister: ztest: short test case names on --no-detailed-test-id
Extend `--no-detailed-test-id` command line option: in addition to its
current behavior to exclude from a test Suite name its configuration path
prefix, also don't prefix each Ztest Case name with its Scenario name.
For example: 'kernel.common.timing' Scenario name, the same Suite name,
and 'sleep.usleep' test Case (where 'sleep' is its Ztest suite name
and 'usleep' is Ztest test name.
This way both TestSuite and TestCase names follow the same principle
having no parent object name prefix.
There is no information loss in Twister reports with this naming:
TestSuite is a container object for its TestCases, whereas TestSuite
has its configuration path as a property.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
@ -261,8 +261,7 @@ A Test Suite is a collection of Test Cases which are intended to be used to test
@@ -261,8 +261,7 @@ A Test Suite is a collection of Test Cases which are intended to be used to test
a software program to ensure it meets certain requirements. The Test Cases in a
Test Suite are either related or meant to be executed together.
The name of each Test Scenario needs to be unique in the context of the overall
test application and has to follow basic rules:
Test Scenario, Test Suite, and Test Case names must follow to these basic rules:
#. The format of the Test Scenario identifier shall be a string without any spaces or
special characters (allowed characters: alphanumeric and [\_=]) consisting
@ -272,7 +271,8 @@ test application and has to follow basic rules:
@@ -272,7 +271,8 @@ test application and has to follow basic rules:
subsection names delimited with a dot (``.``). For example, a test scenario
that covers semaphores in the kernel shall start with ``kernel.semaphore``.
#. All Test Scenario identifiers within a ``testcase.yaml`` file need to be unique.
#. All Test Scenario identifiers within a Test Configuration (``testcase.yaml`` file)
need to be unique.
For example a ``testcase.yaml`` file covering semaphores in the kernel can have:
* ``kernel.semaphore``: For general semaphore tests
@ -295,6 +295,18 @@ test application and has to follow basic rules:
@@ -295,6 +295,18 @@ test application and has to follow basic rules:
Test Case name, for example: ``debug.coredump.logging_backend``.
The ``--no-detailed-test-id`` command line option modifies the above rules in this way:
#. A Test Suite name has only ``<Test Scenario identifier>`` component.
Its Application Project path can be found in ``twister.json`` report as ``path:`` property.
#. With short Test Suite names in this mode, all corresponding Test Scenario names
must be unique for the Twister execution scope.
#. **Ztest** Test Case names have only Ztest components ``<Ztest suite name>.<Ztest test name>``.
Its parent Test Suite name equals to the corresponding Test Scenario identifier.
The following is an example test configuration with a few options that are
@ -578,15 +578,21 @@ structure in the main Zephyr tree: boards/<vendor>/<board_name>/""")
@@ -578,15 +578,21 @@ structure in the main Zephyr tree: boards/<vendor>/<board_name>/""")
parser.add_argument(
'--detailed-test-id',action='store_true',
help="Include paths to tests' locations in tests' names. Names will follow "