From 0537f6f4fc373e61c1d32fe1e4d7fa43ac54c93c Mon Sep 17 00:00:00 2001 From: Frederic Martinsons Date: Wed, 2 Aug 2023 15:23:52 +0200 Subject: ref-manual: classes.rst: suppress rust-hello-world reference, add ptest-cargo class (From yocto-docs rev: 8b1f41ebef4e02d9b0d50ce7e69cb90c83eb4324) Signed-off-by: Frederic Martinsons Reviewed-by: Michael Opdenacker Signed-off-by: Richard Purdie --- documentation/ref-manual/classes.rst | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'documentation') diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index a7819d5b60..973070dfb1 100644 --- a/documentation/ref-manual/classes.rst +++ b/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 ` -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 ` +recipe. Another example, with only crate dependencies, is the :oe_git:`uutils-coreutils ` recipe, which was generated by the `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`` -- cgit v1.2.3-54-g00ecf