summaryrefslogtreecommitdiffstats
path: root/Documentation/dev-tools
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2017-05-26 14:44:00 -0400
committerShuah Khan <shuahkh@osg.samsung.com>2017-06-07 12:07:21 -0400
commitcef04cdcb4275592ed6b6822e1939de44acce15b (patch)
tree824845cd76e54c73e98fb491d13cdfa6ca9bd0f7 /Documentation/dev-tools
parent55c70f11e729f17c86f2400a457138682e03b00f (diff)
Documentation/dev-tools: Use reStructuredText markups for kselftest
Include and convert kselftest to the Sphinx format. Signed-off-by: Mickaël Salaün <mic@digikod.net> Acked-by: Kees Cook <keescook@chromium.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'Documentation/dev-tools')
-rw-r--r--Documentation/dev-tools/index.rst1
-rw-r--r--Documentation/dev-tools/kselftest.rst67
2 files changed, 41 insertions, 27 deletions
diff --git a/Documentation/dev-tools/index.rst b/Documentation/dev-tools/index.rst
index 07d881147ef3..e50054c6aeaa 100644
--- a/Documentation/dev-tools/index.rst
+++ b/Documentation/dev-tools/index.rst
@@ -23,6 +23,7 @@ whole; patches welcome!
23 kmemleak 23 kmemleak
24 kmemcheck 24 kmemcheck
25 gdb-kernel-debugging 25 gdb-kernel-debugging
26 kselftest
26 27
27 28
28.. only:: subproject and html 29.. only:: subproject and html
diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst
index 5bd590335839..9232ce94612c 100644
--- a/Documentation/dev-tools/kselftest.rst
+++ b/Documentation/dev-tools/kselftest.rst
@@ -1,4 +1,6 @@
1======================
1Linux Kernel Selftests 2Linux Kernel Selftests
3======================
2 4
3The kernel contains a set of "self tests" under the tools/testing/selftests/ 5The kernel contains a set of "self tests" under the tools/testing/selftests/
4directory. These are intended to be small tests to exercise individual code 6directory. These are intended to be small tests to exercise individual code
@@ -15,29 +17,34 @@ hotplug test is run on 2% of hotplug capable memory instead of 10%.
15Running the selftests (hotplug tests are run in limited mode) 17Running the selftests (hotplug tests are run in limited mode)
16============================================================= 18=============================================================
17 19
18To build the tests: 20To build the tests::
19 $ make -C tools/testing/selftests 21
22 make -C tools/testing/selftests
23
24To run the tests::
20 25
26 make -C tools/testing/selftests run_tests
21 27
22To run the tests: 28To build and run the tests with a single command, use::
23 $ make -C tools/testing/selftests run_tests
24 29
25To build and run the tests with a single command, use: 30 make kselftest
26 $ make kselftest
27 31
28- note that some tests will require root privileges. 32Note that some tests will require root privileges.
29 33
30 34
31Running a subset of selftests 35Running a subset of selftests
32======================================== 36=============================
37
33You can use the "TARGETS" variable on the make command line to specify 38You can use the "TARGETS" variable on the make command line to specify
34single test to run, or a list of tests to run. 39single test to run, or a list of tests to run.
35 40
36To run only tests targeted for a single subsystem: 41To run only tests targeted for a single subsystem::
37 $ make -C tools/testing/selftests TARGETS=ptrace run_tests 42
43 make -C tools/testing/selftests TARGETS=ptrace run_tests
38 44
39You can specify multiple tests to build and run: 45You can specify multiple tests to build and run::
40 $ make TARGETS="size timers" kselftest 46
47 make TARGETS="size timers" kselftest
41 48
42See the top-level tools/testing/selftests/Makefile for the list of all 49See the top-level tools/testing/selftests/Makefile for the list of all
43possible targets. 50possible targets.
@@ -46,13 +53,15 @@ possible targets.
46Running the full range hotplug selftests 53Running the full range hotplug selftests
47======================================== 54========================================
48 55
49To build the hotplug tests: 56To build the hotplug tests::
50 $ make -C tools/testing/selftests hotplug 57
58 make -C tools/testing/selftests hotplug
59
60To run the hotplug tests::
51 61
52To run the hotplug tests: 62 make -C tools/testing/selftests run_hotplug
53 $ make -C tools/testing/selftests run_hotplug
54 63
55- note that some tests will require root privileges. 64Note that some tests will require root privileges.
56 65
57 66
58Install selftests 67Install selftests
@@ -62,13 +71,15 @@ You can use kselftest_install.sh tool installs selftests in default
62location which is tools/testing/selftests/kselftest or a user specified 71location which is tools/testing/selftests/kselftest or a user specified
63location. 72location.
64 73
65To install selftests in default location: 74To install selftests in default location::
66 $ cd tools/testing/selftests
67 $ ./kselftest_install.sh
68 75
69To install selftests in a user specified location: 76 cd tools/testing/selftests
70 $ cd tools/testing/selftests 77 ./kselftest_install.sh
71 $ ./kselftest_install.sh install_dir 78
79To install selftests in a user specified location::
80
81 cd tools/testing/selftests
82 ./kselftest_install.sh install_dir
72 83
73Running installed selftests 84Running installed selftests
74=========================== 85===========================
@@ -79,8 +90,10 @@ named "run_kselftest.sh" to run the tests.
79You can simply do the following to run the installed Kselftests. Please 90You can simply do the following to run the installed Kselftests. Please
80note some tests will require root privileges. 91note some tests will require root privileges.
81 92
82cd kselftest 93::
83./run_kselftest.sh 94
95 cd kselftest
96 ./run_kselftest.sh
84 97
85Contributing new tests 98Contributing new tests
86====================== 99======================
@@ -96,8 +109,8 @@ In general, the rules for selftests are
96 * Don't cause the top-level "make run_tests" to fail if your feature is 109 * Don't cause the top-level "make run_tests" to fail if your feature is
97 unconfigured. 110 unconfigured.
98 111
99Contributing new tests(details) 112Contributing new tests (details)
100=============================== 113================================
101 114
102 * Use TEST_GEN_XXX if such binaries or files are generated during 115 * Use TEST_GEN_XXX if such binaries or files are generated during
103 compiling. 116 compiling.