Message ID | 20230802184810.193478-1-michael.opdenacker@bootlin.com |
---|---|
State | New |
Headers | show |
Series | [v2] ref-manual: classes.rst: suppress rust-hello-world reference, add ptest-cargo class | expand |
Le mer. 2 août 2023, 20:48, <michael.opdenacker@bootlin.com> a écrit : > From: Michael Opdenacker <michael.opdenacker@bootlin.com> > > From: Frederic Martinsons <frederic.martinsons@gmail.com> > > Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> > Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> > > --- > > 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(-) > > 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 > </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`` > -- > 2.34.1 > Thanks Michael for all the fixes to my patch. >
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 </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``