Uriel Guajardo | 359a376 | 2021-03-11 07:23:13 -0800 | [diff] [blame] | 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 | |
Daniel Latypov | f65968a | 2021-04-06 10:29:01 -0700 | [diff] [blame] | 22 | static inline __printf(3, 4) void __kunit_fail_current_test(const char *file, int line, |
| 23 | const char *fmt, ...) |
Uriel Guajardo | 359a376 | 2021-03-11 07:23:13 -0800 | [diff] [blame] | 24 | { |
| 25 | } |
| 26 | |
| 27 | #endif |
| 28 | |
| 29 | #endif /* _KUNIT_TEST_BUG_H */ |