diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-23 09:40:14 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-23 09:40:14 -0800 |
| commit | 89f1a2440a200918676f9e1eeb765b337f735d86 (patch) | |
| tree | 3d67436748b070c4d973c9873f262d56935f5cdc /lib/kunit/hooks.c | |
| parent | d6296cb65320be16dbf20f2fd584ddc25f3437cd (diff) | |
| parent | 82649c7c0da431d147a75c6ae768ee42c1053f53 (diff) | |
| download | linux-89f1a2440a200918676f9e1eeb765b337f735d86.tar.gz linux-89f1a2440a200918676f9e1eeb765b337f735d86.tar.bz2 linux-89f1a2440a200918676f9e1eeb765b337f735d86.zip | |
Merge tag 'linux-kselftest-kunit-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull KUnit update from Shuah Khan:
- add Function Redirection API to isolate the code being tested from
other parts of the kernel.
Documentation/dev-tools/kunit/api/functionredirection.rst has the
details.
* tag 'linux-kselftest-kunit-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
kunit: Add printf attribute to fail_current_test_impl
lib/hashtable_test.c: add test for the hashtable structure
Documentation: Add Function Redirection API docs
kunit: Expose 'static stub' API to redirect functions
kunit: Add "hooks" to call into KUnit when it's built as a module
kunit: kunit.py extract handlers
tools/testing/kunit/kunit.py: remove redundant double check
Diffstat (limited to 'lib/kunit/hooks.c')
| -rw-r--r-- | lib/kunit/hooks.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/kunit/hooks.c b/lib/kunit/hooks.c new file mode 100644 index 000000000000..365d98d4953c --- /dev/null +++ b/lib/kunit/hooks.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit 'Hooks' implementation. + * + * This file contains code / structures which should be built-in even when + * KUnit itself is built as a module. + * + * Copyright (C) 2022, Google LLC. + * Author: David Gow <davidgow@google.com> + */ + + +#include <kunit/test-bug.h> + +DEFINE_STATIC_KEY_FALSE(kunit_running); +EXPORT_SYMBOL(kunit_running); + +/* Function pointers for hooks. */ +struct kunit_hooks_table kunit_hooks; +EXPORT_SYMBOL(kunit_hooks); + |
