-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'linux-kselftest-kunit-5.13-rc1' of git://git.kernel.org/pu…
…b/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: "Several fixes and a new feature to support failure from dynamic analysis tools such as UBSAN and fake ops for testing. - a fake ops struct for testing a "free" function to complain if it was called with an invalid argument, or caught a double-free. Most return void and have no normal means of signalling failure (e.g. super_operations, iommu_ops, etc.)" * tag 'linux-kselftest-kunit-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: kunit: add tips for using current->kunit_test kunit: fix -Wunused-function warning for __kunit_fail_current_test kunit: support failure from dynamic analysis tools kunit: tool: make --kunitconfig accept dirs, add lib/kunit fragment kunit: make KUNIT_EXPECT_STREQ() quote values, don't print literals kunit: Match parenthesis alignment to improve code readability
- Loading branch information
Showing
8 changed files
with
198 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* KUnit API allowing dynamic analysis tools to interact with KUnit tests | ||
* | ||
* Copyright (C) 2020, Google LLC. | ||
* Author: Uriel Guajardo <urielguajardo@google.com> | ||
*/ | ||
|
||
#ifndef _KUNIT_TEST_BUG_H | ||
#define _KUNIT_TEST_BUG_H | ||
|
||
#define kunit_fail_current_test(fmt, ...) \ | ||
__kunit_fail_current_test(__FILE__, __LINE__, fmt, ##__VA_ARGS__) | ||
|
||
#if IS_BUILTIN(CONFIG_KUNIT) | ||
|
||
extern __printf(3, 4) void __kunit_fail_current_test(const char *file, int line, | ||
const char *fmt, ...); | ||
|
||
#else | ||
|
||
static inline __printf(3, 4) void __kunit_fail_current_test(const char *file, int line, | ||
const char *fmt, ...) | ||
{ | ||
} | ||
|
||
#endif | ||
|
||
#endif /* _KUNIT_TEST_BUG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_KUNIT=y | ||
CONFIG_KUNIT_TEST=y | ||
CONFIG_KUNIT_EXAMPLE_TEST=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters