Skip to content

Commit

Permalink
docs: rust: Move testing to a separate page
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dirkbehme authored and ojeda committed Feb 18, 2024
1 parent 8d52679 commit e3db8c1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
24 changes: 0 additions & 24 deletions Documentation/rust/general-information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,3 @@ 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
-------

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
via ``kunit_tool`` (``kunit.py``) on the command line::

./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y

Alternatively, KUnit can run them as kernel built-in at boot. Refer to
Documentation/dev-tools/kunit/index.rst for the general KUnit documentation
and Documentation/dev-tools/kunit/architecture.rst for the details of kernel
built-in vs. command line testing.

Additionally, there are the ``#[test]`` tests. These can be run using
the ``rusttest`` Make target::

make LLVM=1 rusttest

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.
1 change: 1 addition & 0 deletions Documentation/rust/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ configurations.
general-information
coding-guidelines
arch-support
testing

.. only:: subproject and html

Expand Down
24 changes: 24 additions & 0 deletions Documentation/rust/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. SPDX-License-Identifier: GPL-2.0
Testing
=======

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
via ``kunit_tool`` (``kunit.py``) on the command line::

./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch x86_64 --kconfig_add CONFIG_RUST=y

Alternatively, KUnit can run them as kernel built-in at boot. Refer to
Documentation/dev-tools/kunit/index.rst for the general KUnit documentation
and Documentation/dev-tools/kunit/architecture.rst for the details of kernel
built-in vs. command line testing.

Additionally, there are the ``#[test]`` tests. These can be run using
the ``rusttest`` Make target::

make LLVM=1 rusttest

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.

0 comments on commit e3db8c1

Please sign in to comment.