diff options
| author | Mickaël Salaün <mic@digikod.net> | 2017-05-26 14:44:00 -0400 |
|---|---|---|
| committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-06-07 12:07:21 -0400 |
| commit | cef04cdcb4275592ed6b6822e1939de44acce15b (patch) | |
| tree | 824845cd76e54c73e98fb491d13cdfa6ca9bd0f7 /Documentation/dev-tools | |
| parent | 55c70f11e729f17c86f2400a457138682e03b00f (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.rst | 1 | ||||
| -rw-r--r-- | Documentation/dev-tools/kselftest.rst | 67 |
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 | ====================== | ||
| 1 | Linux Kernel Selftests | 2 | Linux Kernel Selftests |
| 3 | ====================== | ||
| 2 | 4 | ||
| 3 | The kernel contains a set of "self tests" under the tools/testing/selftests/ | 5 | The kernel contains a set of "self tests" under the tools/testing/selftests/ |
| 4 | directory. These are intended to be small tests to exercise individual code | 6 | directory. 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%. | |||
| 15 | Running the selftests (hotplug tests are run in limited mode) | 17 | Running the selftests (hotplug tests are run in limited mode) |
| 16 | ============================================================= | 18 | ============================================================= |
| 17 | 19 | ||
| 18 | To build the tests: | 20 | To build the tests:: |
| 19 | $ make -C tools/testing/selftests | 21 | |
| 22 | make -C tools/testing/selftests | ||
| 23 | |||
| 24 | To run the tests:: | ||
| 20 | 25 | ||
| 26 | make -C tools/testing/selftests run_tests | ||
| 21 | 27 | ||
| 22 | To run the tests: | 28 | To build and run the tests with a single command, use:: |
| 23 | $ make -C tools/testing/selftests run_tests | ||
| 24 | 29 | ||
| 25 | To 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. | 32 | Note that some tests will require root privileges. |
| 29 | 33 | ||
| 30 | 34 | ||
| 31 | Running a subset of selftests | 35 | Running a subset of selftests |
| 32 | ======================================== | 36 | ============================= |
| 37 | |||
| 33 | You can use the "TARGETS" variable on the make command line to specify | 38 | You can use the "TARGETS" variable on the make command line to specify |
| 34 | single test to run, or a list of tests to run. | 39 | single test to run, or a list of tests to run. |
| 35 | 40 | ||
| 36 | To run only tests targeted for a single subsystem: | 41 | To 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 | ||
| 39 | You can specify multiple tests to build and run: | 45 | You can specify multiple tests to build and run:: |
| 40 | $ make TARGETS="size timers" kselftest | 46 | |
| 47 | make TARGETS="size timers" kselftest | ||
| 41 | 48 | ||
| 42 | See the top-level tools/testing/selftests/Makefile for the list of all | 49 | See the top-level tools/testing/selftests/Makefile for the list of all |
| 43 | possible targets. | 50 | possible targets. |
| @@ -46,13 +53,15 @@ possible targets. | |||
| 46 | Running the full range hotplug selftests | 53 | Running the full range hotplug selftests |
| 47 | ======================================== | 54 | ======================================== |
| 48 | 55 | ||
| 49 | To build the hotplug tests: | 56 | To build the hotplug tests:: |
| 50 | $ make -C tools/testing/selftests hotplug | 57 | |
| 58 | make -C tools/testing/selftests hotplug | ||
| 59 | |||
| 60 | To run the hotplug tests:: | ||
| 51 | 61 | ||
| 52 | To 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. | 64 | Note that some tests will require root privileges. |
| 56 | 65 | ||
| 57 | 66 | ||
| 58 | Install selftests | 67 | Install selftests |
| @@ -62,13 +71,15 @@ You can use kselftest_install.sh tool installs selftests in default | |||
| 62 | location which is tools/testing/selftests/kselftest or a user specified | 71 | location which is tools/testing/selftests/kselftest or a user specified |
| 63 | location. | 72 | location. |
| 64 | 73 | ||
| 65 | To install selftests in default location: | 74 | To install selftests in default location:: |
| 66 | $ cd tools/testing/selftests | ||
| 67 | $ ./kselftest_install.sh | ||
| 68 | 75 | ||
| 69 | To 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 | |
| 79 | To install selftests in a user specified location:: | ||
| 80 | |||
| 81 | cd tools/testing/selftests | ||
| 82 | ./kselftest_install.sh install_dir | ||
| 72 | 83 | ||
| 73 | Running installed selftests | 84 | Running installed selftests |
| 74 | =========================== | 85 | =========================== |
| @@ -79,8 +90,10 @@ named "run_kselftest.sh" to run the tests. | |||
| 79 | You can simply do the following to run the installed Kselftests. Please | 90 | You can simply do the following to run the installed Kselftests. Please |
| 80 | note some tests will require root privileges. | 91 | note some tests will require root privileges. |
| 81 | 92 | ||
| 82 | cd kselftest | 93 | :: |
| 83 | ./run_kselftest.sh | 94 | |
| 95 | cd kselftest | ||
| 96 | ./run_kselftest.sh | ||
| 84 | 97 | ||
| 85 | Contributing new tests | 98 | Contributing 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 | ||
| 99 | Contributing new tests(details) | 112 | Contributing 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. |
