/* SPDX-License-Identifier: GPL-2.0 */1/*2* KUnit API to save and access test attributes3*4* Copyright (C) 2023, Google LLC.5* Author: Rae Moar <[email protected]>6*/78#ifndef _KUNIT_ATTRIBUTES_H9#define _KUNIT_ATTRIBUTES_H1011/*12* struct kunit_attr_filter - representation of attributes filter with the13* attribute object and string input14*/15struct kunit_attr_filter {16struct kunit_attr *attr;17char *input;18};1920/*21* Returns the name of the filter's attribute.22*/23const char *kunit_attr_filter_name(struct kunit_attr_filter filter);2425/*26* Print all test attributes for a test case or suite.27* Output format for test cases: "# <test_name>.<attribute>: <value>"28* Output format for test suites: "# <attribute>: <value>"29*/30void kunit_print_attr(void *test_or_suite, bool is_test, unsigned int test_level);3132/*33* Returns the number of fitlers in input.34*/35int kunit_get_filter_count(char *input);3637/*38* Parse attributes filter input and return an objects containing the39* attribute object and the string input of the next filter.40*/41struct kunit_attr_filter kunit_next_attr_filter(char **filters, int *err);4243/*44* Returns a copy of the suite containing only tests that pass the filter.45*/46struct kunit_suite *kunit_filter_attr_tests(const struct kunit_suite *const suite,47struct kunit_attr_filter filter, char *action, int *err);4849#endif /* _KUNIT_ATTRIBUTES_H */505152