All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docs: rust: Add instructions for the Rust kselftest
@ 2024-03-29 15:30 Laura Nao
  2024-03-29 16:47 ` Miguel Ojeda
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laura Nao @ 2024-03-29 15:30 UTC (permalink / raw
  To: ojeda, alex.gaynor, wedsonaf
  Cc: boqun.feng, gary, bjorn3_gh, benno.lossin, a.hindborg, aliceryhl,
	rust-for-linux, kernel-linux, dirk.behme, kernel, kernel,
	Laura Nao

Add section describing how to build and run the Rust kselftest.

Signed-off-by: Laura Nao <laura.nao@collabora.com>
---
 Documentation/rust/testing.rst | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/Documentation/rust/testing.rst b/Documentation/rust/testing.rst
index 6658998d1b6c..b5b99e625a01 100644
--- a/Documentation/rust/testing.rst
+++ b/Documentation/rust/testing.rst
@@ -6,10 +6,11 @@ Testing
 This document contains useful information how to test the Rust code in the
 kernel.
 
-There are two sorts of tests:
+There are three sorts of tests:
 
 - The KUnit tests.
 - The ``#[test]`` tests.
+- The Kselftest.
 
 The KUnit tests
 ---------------
@@ -133,3 +134,22 @@ Additionally, there are the ``#[test]`` tests. These can be run using the
 This requires the kernel ``.config`` and downloads external repositories. It
 runs the ``#[test]`` tests on the host (currently) and thus is fairly limited in
 what these tests can test.
+
+The Kselftest
+---------------------
+
+A Kselftest is also available, which verifies that the Rust sample modules
+can be added and removed correctly.
+
+The kernel config options required for the test are listed in the
+tools/testing/selftests/rust/config file and can be included with the aid
+of the merge_config.sh script::
+
+	./scripts/kconfig/merge_config.sh .config tools/testing/selftests/rust/config
+
+To build and run the test, use::
+
+	make TARGETS="rust" kselftest
+
+Refer to Documentation/dev-tools/kselftest.rst for the general Kselftest
+documentation.
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: rust: Add instructions for the Rust kselftest
  2024-03-29 15:30 [PATCH] docs: rust: Add instructions for the Rust kselftest Laura Nao
@ 2024-03-29 16:47 ` Miguel Ojeda
  2024-03-29 17:13 ` Valentin Obst
  2024-04-01 12:48 ` Muhammad Usama Anjum
  2 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2024-03-29 16:47 UTC (permalink / raw
  To: Laura Nao
  Cc: ojeda, alex.gaynor, wedsonaf, boqun.feng, gary, bjorn3_gh,
	benno.lossin, a.hindborg, aliceryhl, rust-for-linux, kernel-linux,
	dirk.behme, kernel, kernel

On Fri, Mar 29, 2024 at 4:30 PM Laura Nao <laura.nao@collabora.com> wrote:
>
> +A Kselftest is also available, which verifies that the Rust sample modules
> +can be added and removed correctly.

Do we want to use the singular? i.e. I guess eventually we may have
several selftests there, thus using the singular, or explaining the
details of a particular test like here, seems a bit too specific,
compared to the other sections.

The patch looks fine otherwise.

Thanks Laura!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: rust: Add instructions for the Rust kselftest
  2024-03-29 15:30 [PATCH] docs: rust: Add instructions for the Rust kselftest Laura Nao
  2024-03-29 16:47 ` Miguel Ojeda
@ 2024-03-29 17:13 ` Valentin Obst
  2024-04-01 12:48 ` Muhammad Usama Anjum
  2 siblings, 0 replies; 4+ messages in thread
From: Valentin Obst @ 2024-03-29 17:13 UTC (permalink / raw
  To: laura.nao
  Cc: a.hindborg, alex.gaynor, aliceryhl, benno.lossin, bjorn3_gh,
	boqun.feng, dirk.behme, gary, kernel-linux, kernel, kernel, ojeda,
	rust-for-linux, wedsonaf

> +
> +The Kselftest
> +---------------------
> +
> +A Kselftest is also available, which verifies that the Rust sample modules
> +can be added and removed correctly.
> +
> +The kernel config options required for the test are listed in the
> +tools/testing/selftests/rust/config file and can be included with the aid
> +of the merge_config.sh script::
> +
> +	./scripts/kconfig/merge_config.sh .config tools/testing/selftests/rust/config
> +
> +To build and run the test, use::
> +
> +	make TARGETS="rust" kselftest
> +

In addition to what Miguel said, I think it would also be useful to
mention that kselftests are expected to be run (e.g. via the above
command) on a system that is _running_ the kernel to be tested.

I think its worth pointing that out since in that sense they are different
from the other tests on this page, for which the example command can be run
from the kernel tree on an arbitrary system. Of course that's all written
in the docs you linked, but I assume spelling it out here will avoid
confusion.

Apart from that it looks good to me.

    - Best Valentin

> +Refer to Documentation/dev-tools/kselftest.rst for the general Kselftest
> +documentation.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: rust: Add instructions for the Rust kselftest
  2024-03-29 15:30 [PATCH] docs: rust: Add instructions for the Rust kselftest Laura Nao
  2024-03-29 16:47 ` Miguel Ojeda
  2024-03-29 17:13 ` Valentin Obst
@ 2024-04-01 12:48 ` Muhammad Usama Anjum
  2 siblings, 0 replies; 4+ messages in thread
From: Muhammad Usama Anjum @ 2024-04-01 12:48 UTC (permalink / raw
  To: Laura Nao, ojeda, alex.gaynor, wedsonaf
  Cc: Muhammad Usama Anjum, boqun.feng, gary, bjorn3_gh, benno.lossin,
	a.hindborg, aliceryhl, rust-for-linux, kernel-linux, dirk.behme,
	kernel, kernel

On 3/29/24 8:30 PM, Laura Nao wrote:
> Add section describing how to build and run the Rust kselftest.
> 
> Signed-off-by: Laura Nao <laura.nao@collabora.com>
You can add following after fixing comments:
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
>  Documentation/rust/testing.rst | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/rust/testing.rst b/Documentation/rust/testing.rst
> index 6658998d1b6c..b5b99e625a01 100644
> --- a/Documentation/rust/testing.rst
> +++ b/Documentation/rust/testing.rst
> @@ -6,10 +6,11 @@ Testing
>  This document contains useful information how to test the Rust code in the
>  kernel.
>  
> -There are two sorts of tests:
> +There are three sorts of tests:
>  
>  - The KUnit tests.
>  - The ``#[test]`` tests.
> +- The Kselftest.
>  
>  The KUnit tests
>  ---------------
> @@ -133,3 +134,22 @@ Additionally, there are the ``#[test]`` tests. These can be run using the
>  This requires the kernel ``.config`` and downloads external repositories. It
>  runs the ``#[test]`` tests on the host (currently) and thus is fairly limited in
>  what these tests can test.
> +
> +The Kselftest
> +---------------------
The number of dashes are more than required. There should have been error
or warning while documentation building. It should be as following:

The Kselftest
-------------

> +
> +A Kselftest is also available, which verifies that the Rust sample modules
> +can be added and removed correctly.
> +
> +The kernel config options required for the test are listed in the
> +tools/testing/selftests/rust/config file and can be included with the aid
> +of the merge_config.sh script::
> +
> +	./scripts/kconfig/merge_config.sh .config tools/testing/selftests/rust/config
> +
> +To build and run the test, use::
> +
> +	make TARGETS="rust" kselftest
> +
> +Refer to Documentation/dev-tools/kselftest.rst for the general Kselftest
> +documentation.

-- 
BR,
Muhammad Usama Anjum

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-01 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 15:30 [PATCH] docs: rust: Add instructions for the Rust kselftest Laura Nao
2024-03-29 16:47 ` Miguel Ojeda
2024-03-29 17:13 ` Valentin Obst
2024-04-01 12:48 ` Muhammad Usama Anjum

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.