From patchwork Wed Aug 2 18:48:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Opdenacker X-Patchwork-Id: 28325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83260C001E0 for ; Wed, 2 Aug 2023 18:48:27 +0000 (UTC) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by mx.groups.io with SMTP id smtpd.web10.4364.1691002105414461124 for ; Wed, 02 Aug 2023 11:48:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bD2/CDe8; spf=pass (domain: bootlin.com, ip: 217.70.183.199, mailfrom: michael.opdenacker@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id 463AAFF802; Wed, 2 Aug 2023 18:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691002103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1RMr4dvFQUUu10KTWsOagGOKJfK1UFka74KDoQlMhSQ=; b=bD2/CDe8kjSbZjD6MkNKWAqnoe6SQM9ENdssVH40xmy4st1Uah4zZ50VybhrIDXHWmzWka 7wRKbuYyjVnan96ltmY/bk8S5BWAt5qXV75SWDUC6OFqNPlKoIcr4+JcfGxeI+HWUVX9Ow olonzondPoUL9vEpTZ7thBXfESzW3OC4TB24Ai07WGo9RmtDRlPnBnOrzELQ7h+5SBPXhB JUjLALxpi2rXdX+WNqp1HPP/QdLQ3HbpyBUdS//QF2VWgL/TlKZfgSC2NDQCQZH9It6UL3 LyfLrdbr0xUkDv3ok7tSGXnI/XfOQAsjz4bOIcZG3d9tyi30t/GsriVhAJuwsQ== From: michael.opdenacker@bootlin.com To: docs@lists.yoctoproject.org Cc: Michael Opdenacker , Frederic Martinsons Subject: [PATCH v2] ref-manual: classes.rst: suppress rust-hello-world reference, add ptest-cargo class Date: Wed, 2 Aug 2023 20:48:10 +0200 Message-Id: <20230802184810.193478-1-michael.opdenacker@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <177798C553711AAA.2497@lists.yoctoproject.org> References: <177798C553711AAA.2497@lists.yoctoproject.org> MIME-Version: 1.0 X-GND-Sasl: michael.opdenacker@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 02 Aug 2023 18:48:27 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4101 From: Michael Opdenacker From: Frederic Martinsons Signed-off-by: Frederic Martinsons Reviewed-by: Michael Opdenacker --- 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 ` -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``