ref-manual: classes.rst: suppress rust-hello-world reference, add ptest-cargo class

(From yocto-docs rev: 8b1f41ebef4e02d9b0d50ce7e69cb90c83eb4324)

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Frederic Martinsons
2023-08-02 15:23:52 +02:00
committed by Richard Purdie
parent 8a11abf6a9
commit 0537f6f4fc

View File

@@ -266,12 +266,15 @@ manager, allowing to fetch package dependencies and build your program.
Using this class makes it very easy to build Rust programs. All you need
is to use the :term:`SRC_URI` variable to point to a source repository
which can be built by Cargo, typically one that was created by the
``cargo new`` command, containing a ``Cargo.toml`` file and a ``src``
``cargo new`` command, containing a ``Cargo.toml`` file, a ``Cargo.lock`` file and a ``src``
subdirectory.
You will find a simple example in the
:oe_git:`rust-hello-world_git.bb </openembedded-core/tree/meta/recipes-extended/rust-example/rust-hello-world_git.bb>`
recipe. A more complex example, with package dependencies, is the
If you want to build and package tests of the program, inherit the
:ref:`ref-classes-ptest-cargo` class instead of :ref:`ref-classes-cargo`.
You will find an example (that show also how to handle possible git source dependencies) in the
:oe_git:`zvariant_3.12.0.bb </openembedded-core/tree/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb>`
recipe. Another example, with only crate dependencies, is the
:oe_git:`uutils-coreutils </meta-openembedded/tree/meta-oe/recipes-core/uutils-coreutils>`
recipe, which was generated by the `cargo-bitbake <https://crates.io/crates/cargo-bitbake>`__
tool.
@@ -2517,6 +2520,17 @@ the class' functionality is largely disabled unless "ptest" appears in
section in the Yocto Project Development Tasks Manual for more information
on ptest.
.. _ref-classes-ptest-cargo:
``ptest-cargo``
===============
The :ref:`ref-classes-ptest-cargo` class is a class which extends the
:ref:`ref-classes-cargo` class and adds ``compile_ptest_cargo`` and
``install_ptest_cargo`` steps to respectively build and install
test suites defined in the ``Cargo.toml`` file, into a dedicated
``-ptest`` package.
.. _ref-classes-ptest-gnome:
``ptest-gnome``