forked from torvalds/linux
-
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-6.6-rc1' of git://git.kernel.org/pub…
…/scm/linux/kernel/git/shuah/linux-kselftest Pull kunit updates from Shuah Khan: - add support for running Rust documentation tests as KUnit tests - make init, str, sync, types doctests compilable/testable - add support for attributes API which include speed, modules attributes, ability to filter and report attributes - add support for marking tests slow using attributes API - add attributes API documentation - fix a wild-memory-access bug in kunit_filter_suites() and a possible memory leak in kunit_filter_suites() - add support for counting number of test suites in a module, list action to kunit test modules, and test filtering on module tests * tag 'linux-kselftest-kunit-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (25 commits) kunit: fix struct kunit_attr header kunit: replace KUNIT_TRIGGER_STATIC_STUB maro with KUNIT_STATIC_STUB_REDIRECT kunit: Allow kunit test modules to use test filtering kunit: Make 'list' action available to kunit test modules kunit: Report the count of test suites in a module kunit: fix uninitialized variables bug in attributes filtering kunit: fix possible memory leak in kunit_filter_suites() kunit: fix wild-memory-access bug in kunit_filter_suites() kunit: Add documentation of KUnit test attributes kunit: add tests for filtering attributes kunit: time: Mark test as slow using test attributes kunit: memcpy: Mark tests as slow using test attributes kunit: tool: Add command line interface to filter and report attributes kunit: Add ability to filter attributes kunit: Add module attribute kunit: Add speed attribute kunit: Add test attributes API structure MAINTAINERS: add Rust KUnit files to the KUnit entry rust: support running Rust documentation tests as KUnit ones rust: types: make doctests compilable/testable ...
- Loading branch information
Showing
38 changed files
with
1,801 additions
and
144 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
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,50 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* KUnit API to save and access test attributes | ||
* | ||
* Copyright (C) 2023, Google LLC. | ||
* Author: Rae Moar <[email protected]> | ||
*/ | ||
|
||
#ifndef _KUNIT_ATTRIBUTES_H | ||
#define _KUNIT_ATTRIBUTES_H | ||
|
||
/* | ||
* struct kunit_attr_filter - representation of attributes filter with the | ||
* attribute object and string input | ||
*/ | ||
struct kunit_attr_filter { | ||
struct kunit_attr *attr; | ||
char *input; | ||
}; | ||
|
||
/* | ||
* Returns the name of the filter's attribute. | ||
*/ | ||
const char *kunit_attr_filter_name(struct kunit_attr_filter filter); | ||
|
||
/* | ||
* Print all test attributes for a test case or suite. | ||
* Output format for test cases: "# <test_name>.<attribute>: <value>" | ||
* Output format for test suites: "# <attribute>: <value>" | ||
*/ | ||
void kunit_print_attr(void *test_or_suite, bool is_test, unsigned int test_level); | ||
|
||
/* | ||
* Returns the number of fitlers in input. | ||
*/ | ||
int kunit_get_filter_count(char *input); | ||
|
||
/* | ||
* Parse attributes filter input and return an objects containing the | ||
* attribute object and the string input of the next filter. | ||
*/ | ||
struct kunit_attr_filter kunit_next_attr_filter(char **filters, int *err); | ||
|
||
/* | ||
* Returns a copy of the suite containing only tests that pass the filter. | ||
*/ | ||
struct kunit_suite *kunit_filter_attr_tests(const struct kunit_suite *const suite, | ||
struct kunit_attr_filter filter, char *action, int *err); | ||
|
||
#endif /* _KUNIT_ATTRIBUTES_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
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
Oops, something went wrong.