xref: /openbmc/linux/include/kunit/test-bug.h (revision b868a02e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * KUnit API allowing dynamic analysis tools to interact with KUnit tests
4  *
5  * Copyright (C) 2020, Google LLC.
6  * Author: Uriel Guajardo <urielguajardo@google.com>
7  */
8 
9 #ifndef _KUNIT_TEST_BUG_H
10 #define _KUNIT_TEST_BUG_H
11 
12 #define kunit_fail_current_test(fmt, ...) \
13 	__kunit_fail_current_test(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
14 
15 #if IS_BUILTIN(CONFIG_KUNIT)
16 
17 extern __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
18 						    const char *fmt, ...);
19 
20 #else
21 
22 static inline __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
23 							    const char *fmt, ...)
24 {
25 }
26 
27 #endif
28 
29 #endif /* _KUNIT_TEST_BUG_H */
30