1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2013 Google, Inc.
12 * struct unit_test_state - Entire state of test system
14 * @fail_count: Number of tests that failed
15 * @start: Store the starting mallinfo when doing leak test
16 * @priv: A pointer to some other info some suites want to track
17 * @of_root: Record of the livetree root node (used for setting up tests)
18 * @expect_str: Temporary string used to hold expected string value
19 * @actual_str: Temporary string used to hold actual string value
21 struct unit_test_state {
23 struct mallinfo start;
25 struct device_node *of_root;
31 * struct unit_test - Information about a unit test
34 * @func: Function to call to perform test
35 * @flags: Flags indicated pre-conditions for test
40 int (*func)(struct unit_test_state *state);
44 /* Declare a new unit test */
45 #define UNIT_TEST(_name, _flags, _suite) \
46 ll_entry_declare(struct unit_test, _name, _suite) = { \
53 /* Sizes for devres tests */
55 TEST_DEVRES_SIZE = 100,
56 TEST_DEVRES_COUNT = 10,
57 TEST_DEVRES_TOTAL = TEST_DEVRES_SIZE * TEST_DEVRES_COUNT,
59 /* A few different sizes */
60 TEST_DEVRES_SIZE2 = 15,
61 TEST_DEVRES_SIZE3 = 37,
64 #endif /* __TEST_TEST_H */