diff options
| author | Mickaël Salaün <[email protected]> | 2017-06-05 20:37:17 +0200 |
|---|---|---|
| committer | Shuah Khan <[email protected]> | 2017-06-07 10:07:22 -0600 |
| commit | 7e6a32abdded8ed3d50ca7d26d17b19ffa0ea34d (patch) | |
| tree | b8674873bfad8dde8f564c21d38add3383c56d51 /Documentation | |
| parent | 1256a525573120a79d5893b7342285f088b47dcc (diff) | |
Documentation/dev-tools: Add kselftest_harness documentation
Add ReST metadata to kselftest_harness.h to be able to include the
comments in the Sphinx documentation.
Signed-off-by: Mickaël Salaün <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Will Drewry <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/dev-tools/kselftest.rst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst index 9232ce94612c..b3861500c42d 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -120,3 +120,36 @@ Contributing new tests (details) executable which is not tested by default. TEST_FILES, TEST_GEN_FILES mean it is the file which is used by test. + +Test Harness +============ + +The kselftest_harness.h file contains useful helpers to build tests. The tests +from tools/testing/selftests/seccomp/seccomp_bpf.c can be used as example. + +Example +------- + +.. kernel-doc:: tools/testing/selftests/kselftest_harness.h + :doc: example + + +Helpers +------- + +.. kernel-doc:: tools/testing/selftests/kselftest_harness.h + :functions: TH_LOG TEST TEST_SIGNAL FIXTURE FIXTURE_DATA FIXTURE_SETUP + FIXTURE_TEARDOWN TEST_F TEST_HARNESS_MAIN + +Operators +--------- + +.. kernel-doc:: tools/testing/selftests/kselftest_harness.h + :doc: operators + +.. kernel-doc:: tools/testing/selftests/kselftest_harness.h + :functions: ASSERT_EQ ASSERT_NE ASSERT_LT ASSERT_LE ASSERT_GT ASSERT_GE + ASSERT_NULL ASSERT_TRUE ASSERT_NULL ASSERT_TRUE ASSERT_FALSE + ASSERT_STREQ ASSERT_STRNE EXPECT_EQ EXPECT_NE EXPECT_LT + EXPECT_LE EXPECT_GT EXPECT_GE EXPECT_NULL EXPECT_TRUE + EXPECT_FALSE EXPECT_STREQ EXPECT_STRNE |