From: John Hubbard <jhubbard@nvidia.com>
To: Dirk Behme <dirk.behme@de.bosch.com>, <rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v3] docs: rust: Add rusttest info
Date: Mon, 11 Dec 2023 19:12:55 -0800 [thread overview]
Message-ID: <df0d8a01-eac3-43b2-8498-e237a0fe6eb5@nvidia.com> (raw)
In-Reply-To: <20231211121613.3489513-1-dirk.behme@de.bosch.com>
On 12/11/23 04:16, Dirk Behme 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>
> ---
>
> 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
"make LLVM=1 <anything>" doesn't work for me, and therefore I suspect it
doesn't work for at least a few other people, as well.
Instead, I have to run "make CC=clang <anything>", which works just
fine.
The docs should consistently reflect this, yes?
> +
> +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
Very helpful! Coming mostly from linux-mm, if someone says "run KUnit", I
have to pause and maybe go look it up, but having the command right in
front of me makes it all easy again. :)
Same comment about LLVM=1 vs. CC=clang, though.
> +
> +See the :doc:`KUnit documentation</dev-tools/kunit/index>` for the details how to use it.
Also good.
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2023-12-12 3:14 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 [this message]
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
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=df0d8a01-eac3-43b2-8498-e237a0fe6eb5@nvidia.com \
--to=jhubbard@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.