aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Kconfig.debug
diff options
context:
space:
mode:
authorDavid Gow <davidgow@google.com>2019-10-24 15:46:31 -0700
committerShuah Khan <skhan@linuxfoundation.org>2019-11-01 11:13:48 -0600
commitea2dd7c0875ed31955cda7b1b20612c8337192e5 (patch)
treedbcf68824bc1cd015728bbdd3f4e2803e366ca41 /lib/Kconfig.debug
parentext4: add kunit test for decoding extended timestamps (diff)
downloadlinux-dev-ea2dd7c0875ed31955cda7b1b20612c8337192e5.tar.xz
linux-dev-ea2dd7c0875ed31955cda7b1b20612c8337192e5.zip
lib/list-test: add a test for the 'list' doubly linked list
Add a KUnit test for the kernel doubly linked list implementation in include/linux/list.h Each test case (list_test_x) is focused on testing the behaviour of the list function/macro 'x'. None of the tests pass invalid lists to these macros, and so should behave identically with DEBUG_LIST enabled and disabled. Note that, at present, it only tests the list_ types (not the singly-linked hlist_), and does not yet test all of the list_for_each_entry* macros (and some related things like list_prepare_entry). Ignoring checkpatch.pl spurious errors related to its handling of for_each and other list macros. checkpatch.pl expects anything with for_each in its name to be a loop and expects that the open brace is placed on the same line as for a for loop. In this case, test case naming scheme includes name of the macro it is testing, which results in the spurious errors. Commit message updated by Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: David Gow <davidgow@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Tested-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r--lib/Kconfig.debug18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index a3017a5dadcd..6c1be6181e38 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1961,6 +1961,24 @@ config SYSCTL_KUNIT_TEST
If unsure, say N.
+config LIST_KUNIT_TEST
+ bool "KUnit Test for Kernel Linked-list structures"
+ depends on KUNIT
+ help
+ This builds the linked list KUnit test suite.
+ It tests that the API and basic functionality of the list_head type
+ and associated macros.
+
+ KUnit tests run during boot and output the results to the debug log
+ in TAP format (http://testanything.org/). Only useful for kernel devs
+ running the KUnit test harness, and not intended for inclusion into a
+ production build.
+
+ For more information on KUnit and unit tests in general please refer
+ to the KUnit documentation in Documentation/dev-tools/kunit/.
+
+ If unsure, say N.
+
config TEST_UDELAY
tristate "udelay test driver"
help