1
0
Fork 0

doc: kselftest: Fix KBUILD_OUTPUT usage instructions

Fix KBUILD_OUTPUT usage instructions. The current documentation is
incorrect. Update and fix outdated information about summary option.
Add a reference to kselftest wiki for additional information on the
framework and tips on writing new tests.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
hifive-unleashed-5.2
Shuah Khan 2019-04-17 17:34:03 -06:00 committed by Jonathan Corbet
parent 3df5ffd2e5
commit 9f436194f9
1 changed files with 29 additions and 13 deletions

View File

@ -7,6 +7,11 @@ directory. These are intended to be small tests to exercise individual code
paths in the kernel. Tests are intended to be run after building, installing paths in the kernel. Tests are intended to be run after building, installing
and booting a kernel. and booting a kernel.
You can find additional information on Kselftest framework, how to
write new tests using the framework on Kselftest wiki:
https://kselftest.wiki.kernel.org/
On some systems, hot-plug tests could hang forever waiting for cpu and On some systems, hot-plug tests could hang forever waiting for cpu and
memory to be ready to be offlined. A special hot-plug target is created memory to be ready to be offlined. A special hot-plug target is created
to run the full range of hot-plug tests. In default mode, hot-plug tests run to run the full range of hot-plug tests. In default mode, hot-plug tests run
@ -31,17 +36,32 @@ To build and run the tests with a single command, use::
Note that some tests will require root privileges. Note that some tests will require root privileges.
Build and run from user specific object directory (make O=dir):: Kselftest supports saving output files in a separate directory and then
running tests. To locate output files in a separate directory two syntaxes
are supported. In both cases the working directory must be the root of the
kernel src. This is applicable to "Running a subset of selftests" section
below.
To build, save output files in a separate directory with O= ::
$ make O=/tmp/kselftest kselftest $ make O=/tmp/kselftest kselftest
Build and run KBUILD_OUTPUT directory (make KBUILD_OUTPUT=):: To build, save output files in a separate directory with KBUILD_OUTPUT ::
$ make KBUILD_OUTPUT=/tmp/kselftest kselftest $ export KBUILD_OUTPUT=/tmp/kselftest; make kselftest
The above commands run the tests and print pass/fail summary to make it The O= assignment takes precedence over the KBUILD_OUTPUT environment
easier to understand the test results. Please find the detailed individual variable.
test results for each test in /tmp/testname file(s).
The above commands by default run the tests and print full pass/fail report.
Kselftest supports "summary" option to make it easier to understand the test
results. Please find the detailed individual test results for each test in
/tmp/testname file(s) when summary option is specified. This is applicable
to "Running a subset of selftests" section below.
To run kselftest with summary option enabled ::
$ make summary=1 kselftest
Running a subset of selftests Running a subset of selftests
============================= =============================
@ -57,17 +77,13 @@ You can specify multiple tests to build and run::
$ make TARGETS="size timers" kselftest $ make TARGETS="size timers" kselftest
Build and run from user specific object directory (make O=dir):: To build, save output files in a separate directory with O= ::
$ make O=/tmp/kselftest TARGETS="size timers" kselftest $ make O=/tmp/kselftest TARGETS="size timers" kselftest
Build and run KBUILD_OUTPUT directory (make KBUILD_OUTPUT=):: To build, save output files in a separate directory with KBUILD_OUTPUT ::
$ make KBUILD_OUTPUT=/tmp/kselftest TARGETS="size timers" kselftest $ export KBUILD_OUTPUT=/tmp/kselftest; make TARGETS="size timers" kselftest
The above commands run the tests and print pass/fail summary to make it
easier to understand the test results. Please find the detailed individual
test results for each test in /tmp/testname file(s).
See the top-level tools/testing/selftests/Makefile for the list of all See the top-level tools/testing/selftests/Makefile for the list of all
possible targets. possible targets.