Skip to content

Commit c4714b0

Browse files
Rubuschshuahkh
authored andcommitted
Documentation: test.h - fix warnings
Fix warnings at 'make htmldocs', and formatting issues in the resulting documentation. - test.h: Fix annotation in kernel-doc parameter description. - Documentation/*.rst: Fixing formatting issues, and a duplicate label issue due to usage of sphinx.ext.autosectionlabel and identical labels within one document (sphinx warning) Signed-off-by: Lothar Rubusch <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 45ba7a8 commit c4714b0

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

Documentation/dev-tools/kunit/start.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ test targets as well. The ``.kunitconfig`` should also contain any other config
3232
options required by the tests.
3333

3434
A good starting point for a ``.kunitconfig`` is the KUnit defconfig:
35+
3536
.. code-block:: bash
3637
3738
cd $PATH_TO_LINUX_REPO
3839
cp arch/um/configs/kunit_defconfig .kunitconfig
3940
4041
You can then add any other Kconfig options you wish, e.g.:
42+
4143
.. code-block:: none
4244
43-
CONFIG_LIST_KUNIT_TEST=y
45+
CONFIG_LIST_KUNIT_TEST=y
4446
4547
:doc:`kunit_tool <kunit-tool>` will ensure that all config options set in
4648
``.kunitconfig`` are set in the kernel ``.config`` before running the tests.
@@ -54,8 +56,8 @@ using.
5456
other tools (such as make menuconfig) to adjust other config options.
5557

5658

57-
Running the tests
58-
-----------------
59+
Running the tests (KUnit Wrapper)
60+
---------------------------------
5961

6062
To make sure that everything is set up correctly, simply invoke the Python
6163
wrapper from your kernel repo:
@@ -105,8 +107,9 @@ have config options ending in ``_KUNIT_TEST``.
105107
KUnit and KUnit tests can be compiled as modules: in this case the tests in a
106108
module will be run when the module is loaded.
107109

108-
Running the tests
109-
-----------------
110+
111+
Running the tests (w/o KUnit Wrapper)
112+
-------------------------------------
110113

111114
Build and run your kernel as usual. Test output will be written to the kernel
112115
log in `TAP <https://testanything.org/>`_ format.

Documentation/dev-tools/kunit/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ able to run one test case per invocation.
595595
KUnit debugfs representation
596596
============================
597597
When kunit test suites are initialized, they create an associated directory
598-
in /sys/kernel/debug/kunit/<test-suite>. The directory contains one file
598+
in ``/sys/kernel/debug/kunit/<test-suite>``. The directory contains one file
599599

600600
- results: "cat results" displays results of each test case and the results
601601
of the entire suite for the last test run.
@@ -604,4 +604,4 @@ The debugfs representation is primarily of use when kunit test suites are
604604
run in a native environment, either as modules or builtin. Having a way
605605
to display results like this is valuable as otherwise results can be
606606
intermixed with other events in dmesg output. The maximum size of each
607-
results file is KUNIT_LOG_SIZE bytes (defined in include/kunit/test.h).
607+
results file is KUNIT_LOG_SIZE bytes (defined in ``include/kunit/test.h``).

include/kunit/test.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ struct kunit_suite {
175175
void (*exit)(struct kunit *test);
176176
struct kunit_case *test_cases;
177177

178-
/* private - internal use only */
178+
/* private: internal use only */
179179
struct dentry *debugfs;
180180
char *log;
181181
};
@@ -232,12 +232,12 @@ void __kunit_test_suites_exit(struct kunit_suite **suites);
232232
* kunit_test_suites() - used to register one or more &struct kunit_suite
233233
* with KUnit.
234234
*
235-
* @suites: a statically allocated list of &struct kunit_suite.
235+
* @suites_list...: a statically allocated list of &struct kunit_suite.
236236
*
237-
* Registers @suites with the test framework. See &struct kunit_suite for
237+
* Registers @suites_list with the test framework. See &struct kunit_suite for
238238
* more information.
239239
*
240-
* When builtin, KUnit tests are all run as late_initcalls; this means
240+
* When builtin, KUnit tests are all run as late_initcalls; this means
241241
* that they cannot test anything where tests must run at a different init
242242
* phase. One significant restriction resulting from this is that KUnit
243243
* cannot reliably test anything that is initialize in the late_init phase;
@@ -253,8 +253,8 @@ void __kunit_test_suites_exit(struct kunit_suite **suites);
253253
* tests from the same place, and at the very least to do so after
254254
* everything else is definitely initialized.
255255
*/
256-
#define kunit_test_suites(...) \
257-
static struct kunit_suite *suites[] = { __VA_ARGS__, NULL}; \
256+
#define kunit_test_suites(suites_list...) \
257+
static struct kunit_suite *suites[] = {suites_list, NULL}; \
258258
static int kunit_test_suites_init(void) \
259259
{ \
260260
return __kunit_test_suites_init(suites); \

0 commit comments

Comments
 (0)