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