summaryrefslogtreecommitdiff
path: root/poky/documentation/ref-manual/classes.rst
diff options
context:
space:
mode:
Diffstat (limited to 'poky/documentation/ref-manual/classes.rst')
-rw-r--r--poky/documentation/ref-manual/classes.rst26
1 files changed, 20 insertions, 6 deletions
diff --git a/poky/documentation/ref-manual/classes.rst b/poky/documentation/ref-manual/classes.rst
index a7819d5b60..3f0d4844e8 100644
--- a/poky/documentation/ref-manual/classes.rst
+++ b/poky/documentation/ref-manual/classes.rst
@@ -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.
@@ -290,8 +293,6 @@ An exception is the "rust" recipe, to build the Rust compiler and runtime
library, which is built by Cargo but cannot use the :ref:`ref-classes-cargo`
class. This is why this class was introduced.
-.. _ref-classes-ccache:
-
.. _ref-classes-cargo-update-recipe-crates:
``cargo-update-recipe-crates``
@@ -316,6 +317,8 @@ recipe::
That's also something you can achieve by using the
`cargo-bitbake <https://crates.io/crates/cargo-bitbake>`__ tool.
+.. _ref-classes-ccache:
+
``ccache``
==========
@@ -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``