diff mbox series

test-manual/ptest.rst: detail the exit code and output requirements

Message ID 20260109-ptest-output-v1-1-29b1b2039c97@bootlin.com
State Under Review
Headers show
Series test-manual/ptest.rst: detail the exit code and output requirements | expand

Commit Message

Antonin Godard Jan. 9, 2026, 10:45 a.m. UTC
A ptest must emit at least one test result on the console, as this is
required by the testimage class (which ignores the exit code).
ptest-runner on the other hand, ignore the output and only cares about
the exit code.

Add these two items as requirements for a ptest to be valid.

Fixes [YOCTO #15832]

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/test-manual/ptest.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)


---
base-commit: f9042e1da554017fe46460c1fd2bdf8c74b3fa18
change-id: 20260109-ptest-output-29a943659c2e

Comments

Yoann Congal Jan. 9, 2026, 10:52 a.m. UTC | #1
Le ven. 9 janv. 2026 à 11:45, Antonin Godard <antonin.godard@bootlin.com> a
écrit :

> A ptest must emit at least one test result on the console, as this is
> required by the testimage class (which ignores the exit code).
> ptest-runner on the other hand, ignore the output and only cares about
> the exit code.
>
> Add these two items as requirements for a ptest to be valid.
>
> Fixes [YOCTO #15832]
>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
>

Thanks!

Looks good to me :)
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>


> ---
>  documentation/test-manual/ptest.rst | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/documentation/test-manual/ptest.rst
> b/documentation/test-manual/ptest.rst
> index 4e6be35df..1c946f81d 100644
> --- a/documentation/test-manual/ptest.rst
> +++ b/documentation/test-manual/ptest.rst
> @@ -91,6 +91,25 @@ test. Here is what you have to do for each recipe:
>        cd test
>        make -k runtest-TESTS
>
> +-  *Return an appropriate exit code*: The ``run-ptest`` script must
> return 0 on
> +   success, 1 on failure. This is needed by ``ptest-runner`` to keep
> track of
> +   the successful and failed tests.
> +
> +-  *Make sure the test prints at least one test result*: The execution of
> the
> +   ``run-ptest`` script must result in at least one test result output on
> the
> +   console, with the following format::
> +
> +      result: testname
> +
> +   Where ``result`` can be one of ``PASS``, ``SKIP``, or ``FAIL``.
> ``testname``
> +   can be any name.
> +
> +   There can be as many test results as desired.
> +
> +   This information is read by the :ref:`ref-classes-testimage` class and
> +   :oe_git:`logparser
> </openembedded-core/tree/meta/lib/oeqa/utils/logparser.py>`
> +   module.
> +
>  -  *Ensure dependencies are met:* If the test adds build or runtime
>     dependencies that normally do not exist for the package (such as
>     requiring "make" to run the test suite), use the
>
> ---
> base-commit: f9042e1da554017fe46460c1fd2bdf8c74b3fa18
> change-id: 20260109-ptest-output-29a943659c2e
>
>
diff mbox series

Patch

diff --git a/documentation/test-manual/ptest.rst b/documentation/test-manual/ptest.rst
index 4e6be35df..1c946f81d 100644
--- a/documentation/test-manual/ptest.rst
+++ b/documentation/test-manual/ptest.rst
@@ -91,6 +91,25 @@  test. Here is what you have to do for each recipe:
       cd test
       make -k runtest-TESTS
 
+-  *Return an appropriate exit code*: The ``run-ptest`` script must return 0 on
+   success, 1 on failure. This is needed by ``ptest-runner`` to keep track of
+   the successful and failed tests.
+
+-  *Make sure the test prints at least one test result*: The execution of the
+   ``run-ptest`` script must result in at least one test result output on the
+   console, with the following format::
+
+      result: testname
+
+   Where ``result`` can be one of ``PASS``, ``SKIP``, or ``FAIL``. ``testname``
+   can be any name.
+
+   There can be as many test results as desired.
+
+   This information is read by the :ref:`ref-classes-testimage` class and
+   :oe_git:`logparser </openembedded-core/tree/meta/lib/oeqa/utils/logparser.py>`
+   module.
+
 -  *Ensure dependencies are met:* If the test adds build or runtime
    dependencies that normally do not exist for the package (such as
    requiring "make" to run the test suite), use the