Skip to content

Commit

Permalink
selftests: add a simple doc
Browse files Browse the repository at this point in the history
This change adds a little documentation to the tests under
tools/testing/selftests/, based on akpm's explanation.

[[email protected]: move from Documentation to tools/testing/selftests/README.txt]
Signed-off-by: Jeremy Kerr <[email protected]>
Cc: Dave Young <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jk-ozlabs authored and torvalds committed Feb 28, 2013
1 parent 66a01b9 commit 80d0342
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tools/testing/selftests/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Linux Kernel Selftests

The kernel contains a set of "self tests" under the tools/testing/selftests/
directory. These are intended to be small unit tests to exercise individual
code paths in the kernel.

Running the selftests
=====================

To build the tests:

$ make -C tools/testing/selftests


To run the tests:

$ make -C tools/testing/selftests run_tests

- note that some tests will require root privileges.


To run only tests targetted for a single subsystem:

$ make -C tools/testing/selftests TARGETS=cpu-hotplug run_tests

See the top-level tools/testing/selftests/Makefile for the list of all possible
targets.


Contributing new tests
======================

In general, the rules for for selftests are

* Do as much as you can if you're not root;

* Don't take too long;

* Don't break the build on any architecture, and

* Don't cause the top-level "make run_tests" to fail if your feature is
unconfigured.

0 comments on commit 80d0342

Please sign in to comment.