ref-manual: classes.rst: suppress rust-hello-world reference, add ptest-cargo class
PATCH v2 1/1 ref-manual: classes.rst: suppress rust-hello-world reference, add ptest-cargo class
In reply to a message not in the archiveFrom: Michael Opdenacker <[email protected]>
From: Frederic Martinsons <[email protected]>
---
Changes in V2:
- Fix commit title
(was suggesting that ptest-cargo was removed)
- Misc style and grammar fixes
- Replace "_" by "-" in the "ptest_cargo" name
- Move the "ptest-cargo" description further in the file to keep the alphabetic ordering of class names.
--- documentation/ref-manual/classes.rst | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
documentation/ref-manual/classes.rst +18 -4
@@ -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``
Signature · 1 line
2.34.1
Quoted 74 lines · Le mer. 2 août 2023, 20:48, <[email protected]> a écrit :
From: Michael Opdenacker <[email protected]>
From: Frederic Martinsons <[email protected]>
Signed-off-by Frederic Martinsons <[email protected]>Reviewed-by Michael Opdenacker <[email protected]>---
Changes in V2:
- Fix commit title
(was suggesting that ptest-cargo was removed)
- Misc style and grammar fixes
- Replace "_" by "-" in the "ptest_cargo" name
- Move the "ptest-cargo" description further in the file to keep the alphabetic ordering of class names.--- documentation/ref-manual/classes.rst | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)documentation/ref-manual/classes.rst +0
-0@@ -266,12 +266,15 @@ manager, allowing to fetch package dependencies andbuild your program.
Using this class makes it very easy to build Rust programs. All you need is to use the :term:SRC_URIvariable 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>documentation/ref-manual/classes.rst +4
-1-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 gitsource 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.documentation/ref-manual/classes.rst +0
-0@@ -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:
documentation/ref-manual/classes.rst +10
-1+ +``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`` --
Quoted 2 lines
2.34.1
Thanks Michael for all the fixes to my patch.