xref: /openbmc/linux/lib/kunit/hooks-impl.h (revision 7170b7ed)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Declarations for hook implementations.
4  *
5  * These will be set as the function pointers in struct kunit_hook_table,
6  * found in include/kunit/test-bug.h.
7  *
8  * Copyright (C) 2023, Google LLC.
9  * Author: David Gow <davidgow@google.com>
10  */
11 
12 #ifndef _KUNIT_HOOKS_IMPL_H
13 #define _KUNIT_HOOKS_IMPL_H
14 
15 #include <kunit/test-bug.h>
16 
17 /* List of declarations. */
18 void __kunit_fail_current_test_impl(const char *file, int line, const char *fmt, ...);
19 
20 /* Code to set all of the function pointers. */
21 static inline void kunit_install_hooks(void)
22 {
23 	/* Install the KUnit hook functions. */
24 	kunit_hooks.fail_current_test = __kunit_fail_current_test_impl;
25 }
26 
27 #endif /* _KUNIT_HOOKS_IMPL_H */
28