Skip to content

Commit e3db8c1

Browse files
dirkbehmeojeda
authored andcommitted
docs: rust: Move testing to a separate page
To be able to add more testing documentation move the testing section to it's own page. No change on the documentation itself. Suggested-by: Trevor Gross <[email protected]> Suggested-by: Miguel Ojeda <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Reviewed-by: David Gow <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Signed-off-by: Dirk Behme <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 8d52679 commit e3db8c1

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

Documentation/rust/general-information.rst

-24
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,3 @@ configuration:
7777
#[cfg(CONFIG_X="y")] // Enabled as a built-in (`y`)
7878
#[cfg(CONFIG_X="m")] // Enabled as a module (`m`)
7979
#[cfg(not(CONFIG_X))] // Disabled
80-
81-
82-
Testing
83-
-------
84-
85-
There are the tests that come from the examples in the Rust documentation
86-
and get transformed into KUnit tests. These can be run via KUnit. For example
87-
via ``kunit_tool`` (``kunit.py``) on the command line::
88-
89-
./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y
90-
91-
Alternatively, KUnit can run them as kernel built-in at boot. Refer to
92-
Documentation/dev-tools/kunit/index.rst for the general KUnit documentation
93-
and Documentation/dev-tools/kunit/architecture.rst for the details of kernel
94-
built-in vs. command line testing.
95-
96-
Additionally, there are the ``#[test]`` tests. These can be run using
97-
the ``rusttest`` Make target::
98-
99-
make LLVM=1 rusttest
100-
101-
This requires the kernel ``.config`` and downloads external repositories.
102-
It runs the ``#[test]`` tests on the host (currently) and thus is fairly
103-
limited in what these tests can test.

Documentation/rust/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ configurations.
4040
general-information
4141
coding-guidelines
4242
arch-support
43+
testing
4344

4445
.. only:: subproject and html
4546

Documentation/rust/testing.rst

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Testing
4+
=======
5+
6+
There are the tests that come from the examples in the Rust documentation
7+
and get transformed into KUnit tests. These can be run via KUnit. For example
8+
via ``kunit_tool`` (``kunit.py``) on the command line::
9+
10+
./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y
11+
12+
Alternatively, KUnit can run them as kernel built-in at boot. Refer to
13+
Documentation/dev-tools/kunit/index.rst for the general KUnit documentation
14+
and Documentation/dev-tools/kunit/architecture.rst for the details of kernel
15+
built-in vs. command line testing.
16+
17+
Additionally, there are the ``#[test]`` tests. These can be run using
18+
the ``rusttest`` Make target::
19+
20+
make LLVM=1 rusttest
21+
22+
This requires the kernel ``.config`` and downloads external repositories.
23+
It runs the ``#[test]`` tests on the host (currently) and thus is fairly
24+
limited in what these tests can test.

0 commit comments

Comments
 (0)