* [PATCH] docs: rust: Add rusttest info
@ 2023-12-06 12:57 Dirk Behme
2023-12-07 19:43 ` Benno Lossin
2023-12-08 5:31 ` Trevor Gross
0 siblings, 2 replies; 4+ messages in thread
From: Dirk Behme @ 2023-12-06 12:57 UTC (permalink / raw)
To: rust-for-linux; +Cc: dirk.behme
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>
---
Documentation/rust/general-information.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/rust/general-information.rst b/Documentation/rust/general-information.rst
index 081397827a7ea..af9812ce11d7b 100644
--- a/Documentation/rust/general-information.rst
+++ b/Documentation/rust/general-information.rst
@@ -77,3 +77,13 @@ 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
+-------
+
+Running the Rust tests the Make target is::
+
+ make LLVM=1 rusttest
+
+This requires the kernel .config and downloads external repos.
+
--
2.28.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: rust: Add rusttest info
2023-12-06 12:57 [PATCH] docs: rust: Add rusttest info Dirk Behme
@ 2023-12-07 19:43 ` Benno Lossin
2023-12-08 5:31 ` Trevor Gross
1 sibling, 0 replies; 4+ messages in thread
From: Benno Lossin @ 2023-12-07 19:43 UTC (permalink / raw)
To: Dirk Behme, rust-for-linux
On 12/6/23 13:57, 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>
> ---
> Documentation/rust/general-information.rst | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/Documentation/rust/general-information.rst b/Documentation/rust/general-information.rst
> index 081397827a7ea..af9812ce11d7b 100644
> --- a/Documentation/rust/general-information.rst
> +++ b/Documentation/rust/general-information.rst
> @@ -77,3 +77,13 @@ 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
> +-------
> +
> +Running the Rust tests the Make target is::
This sentence sounds a bit weird to me, how about
To run the Rust tests, you can use the following make target::
--
Cheers,
Benno
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: rust: Add rusttest info
2023-12-06 12:57 [PATCH] docs: rust: Add rusttest info Dirk Behme
2023-12-07 19:43 ` Benno Lossin
@ 2023-12-08 5:31 ` Trevor Gross
2023-12-08 12:27 ` Miguel Ojeda
1 sibling, 1 reply; 4+ messages in thread
From: Trevor Gross @ 2023-12-08 5:31 UTC (permalink / raw)
To: Dirk Behme; +Cc: rust-for-linux, Boqun Feng
On Wed, Dec 6, 2023 at 7:58 AM Dirk Behme <dirk.behme@de.bosch.com> wrote:
> +-------
> +
> +Running the Rust tests the Make target is::
> +
> + make LLVM=1 rusttest
> +
> +This requires the kernel .config and downloads external repos.
> +
> --
It may be worth pointing out that you can run via kunit too. Quoting
Boqun in [1]:
> FWIW, I usually run as unit tests by:
>
> ./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y
Thanks for posting this!
- Trevor
[1]: https://rust-for-linux.zulipchat.com/#narrow/stream/291565-Help/topic/Running.20doctests
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: rust: Add rusttest info
2023-12-08 5:31 ` Trevor Gross
@ 2023-12-08 12:27 ` Miguel Ojeda
0 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2023-12-08 12:27 UTC (permalink / raw)
To: Trevor Gross; +Cc: Dirk Behme, rust-for-linux, Boqun Feng
On Fri, Dec 8, 2023 at 6:31 AM Trevor Gross <tmgross@umich.edu> wrote:
>
> It may be worth pointing out that you can run via kunit too. Quoting
> Boqun in [1]:
>
> > FWIW, I usually run as unit tests by:
> >
> > ./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y
Yeah, in fact, those are the "main tests" we have now.
However, I would point to the KUnit docs too, which explain how to run
it and so on (e.g. it is not the only way -- one can also build the
kernel normally and run it), even if we keep Boqun's example.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-08 12:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-06 12:57 [PATCH] docs: rust: Add rusttest info Dirk Behme
2023-12-07 19:43 ` Benno Lossin
2023-12-08 5:31 ` Trevor Gross
2023-12-08 12:27 ` Miguel Ojeda
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).