rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] docs: rust: Add rusttest info
@ 2023-12-11 12:16 Dirk Behme
  2023-12-11 12:30 ` Mika Westerberg
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Dirk Behme @ 2023-12-11 12:16 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>
---

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


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

end of thread, other threads:[~2023-12-15 12:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-12-12 23:48   ` 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).