File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ Testing
66This document contains useful information how to test the Rust code in the
77kernel.
88
9- There are two sorts of tests:
9+ There are three sorts of tests:
1010
1111- The KUnit tests.
1212- The ``#[test] `` tests.
13+ - The Kselftests.
1314
1415The KUnit tests
1516---------------
@@ -133,3 +134,25 @@ Additionally, there are the ``#[test]`` tests. These can be run using the
133134This requires the kernel ``.config `` and downloads external repositories. It
134135runs the ``#[test] `` tests on the host (currently) and thus is fairly limited in
135136what these tests can test.
137+
138+ The Kselftests
139+ --------------
140+
141+ Kselftests are also available in the ``tools/testing/selftests/rust `` folder.
142+
143+ The kernel config options required for the tests are listed in the
144+ ``tools/testing/selftests/rust/config `` file and can be included with the aid
145+ of the ``merge_config.sh `` script::
146+
147+ ./scripts/kconfig/merge_config.sh .config tools/testing/selftests/rust/config
148+
149+ The kselftests are built within the kernel source tree and are intended to
150+ be executed on a system that is running the same kernel.
151+
152+ Once a kernel matching the source tree has been installed and booted, the
153+ tests can be compiled and executed using the following command::
154+
155+ make TARGETS="rust" kselftest
156+
157+ Refer to Documentation/dev-tools/kselftest.rst for the general Kselftest
158+ documentation.
You can’t perform that action at this time.
0 commit comments