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
6
6
This document contains useful information how to test the Rust code in the
7
7
kernel.
8
8
9
- There are two sorts of tests:
9
+ There are three sorts of tests:
10
10
11
11
- The KUnit tests.
12
12
- The ``#[test] `` tests.
13
+ - The Kselftests.
13
14
14
15
The KUnit tests
15
16
---------------
@@ -133,3 +134,25 @@ Additionally, there are the ``#[test]`` tests. These can be run using the
133
134
This requires the kernel ``.config `` and downloads external repositories. It
134
135
runs the ``#[test] `` tests on the host (currently) and thus is fairly limited in
135
136
what 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