rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gow <davidgow@google.com>
To: Dirk Behme <dirk.behme@de.bosch.com>
Cc: rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v3] docs: rust: Add rusttest info
Date: Tue, 12 Dec 2023 12:36:20 +0800	[thread overview]
Message-ID: <CABVgOS=6Psq+BYET6o7KdQhKRP3A2wbTf+smAb54s-a4X--8kw@mail.gmail.com> (raw)
In-Reply-To: <20231211121613.3489513-1-dirk.behme@de.bosch.com>

[-- Attachment #1: Type: text/plain, Size: 2714 bytes --]

On Mon, 11 Dec 2023 at 20:16, Dirk Behme <dirk.behme@de.bosch.com> wrote:
>
> Searching the Rust kernel documentation all existing Rust Make
> targets (rustavailable, rustfmt, rustfmtcheck, rustdoc and
> rust-analyzer) are explicitly documented with their Make syntax.
> While the Make target rusttest is mentioned two times in the
> existing documentation, it's Make syntax is not explicitly
> documented, yet. Add a test section to document this.
>
> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
> ---

The KUnit parts of this look fine to me, though it's not actually
necessary to use --arch x86_64; the default UML should work (if your
host is x86).

There was a previous PR to add some documentation here:
https://github.com/Rust-for-Linux/linux/pull/935

Maybe it'd make sense to borrow some ideas from that and create a
rust/.kunitconfig file so we can move the --kconfig_add CONFIG_RUST=y
(and any other options we may want to enable rust-specific tests)
somewhere.

(Though there's a distinction there between 'I want to test that Rust
support is functional' and 'I want to test something else, but want
Rust support enabled'. I think adding a .kunitconfig would be fine for
both for the time being, though.)

None of those are show-stoppers for me, though, so this is nevertheless

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David

>
> v3: Add the comments from Benno and Miguel. Thanks!
>
>  Documentation/rust/general-information.rst | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/Documentation/rust/general-information.rst b/Documentation/rust/general-information.rst
> index 081397827a7ea..016c7feb433ce 100644
> --- a/Documentation/rust/general-information.rst
> +++ b/Documentation/rust/general-information.rst
> @@ -77,3 +77,22 @@ configuration:
>         #[cfg(CONFIG_X="y")]   // Enabled as a built-in (`y`)
>         #[cfg(CONFIG_X="m")]   // Enabled as a module   (`m`)
>         #[cfg(not(CONFIG_X))]  // Disabled
> +
> +Testing
> +-------
> +
> +To run the Rust tests, you can use the following make target::
> +
> +       make LLVM=1 rusttest
> +
> +This requires the kernel .config and downloads external repos. It
> +runs the ``#[test]`` tests on the host (currently) and thus is fairly
> +limited in what these tests can test.
> +
> +Additonally, there are the tests that come from the examples in the
> +Rust documentation and get transformed into KUnit tests. These can be
> +run via KUnit. For example::
> +
> +       ./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y
> +
> +See the :doc:`KUnit documentation</dev-tools/kunit/index>` for the details how to use it.
> --
> 2.28.0
>
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

  parent reply	other threads:[~2023-12-12  4:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 12:16 [PATCH v3] docs: rust: Add rusttest info Dirk Behme
2023-12-11 12:30 ` Mika Westerberg
2023-12-11 14:54 ` Miguel Ojeda
2023-12-12  3:12 ` John Hubbard
2023-12-12 12:43   ` Miguel Ojeda
2023-12-12 18:11     ` Nathan Chancellor
2023-12-13  1:44     ` John Hubbard
2023-12-15 10:43       ` Miguel Ojeda
2023-12-15 12:52         ` Miguel Ojeda
2023-12-12  4:36 ` David Gow [this message]
2023-12-12 23:48   ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABVgOS=6Psq+BYET6o7KdQhKRP3A2wbTf+smAb54s-a4X--8kw@mail.gmail.com' \
    --to=davidgow@google.com \
    --cc=dirk.behme@de.bosch.com \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).