summaryrefslogtreecommitdiff
path: root/lib/kunit/executor.c
diff options
context:
space:
mode:
authorRae Moar <rmoar@google.com>2023-12-13 19:44:19 +0000
committerShuah Khan <skhan@linuxfoundation.org>2023-12-18 13:21:15 -0700
commit6c4ea2f48de9860217ddfedee081d485dbeea7e8 (patch)
tree40d44e02646f0b498cef60a2e38ce3aedaba5f98 /lib/kunit/executor.c
parent2cf45281570f76f973bd8d17596684d1875002df (diff)
kunit: add is_init test attribute
Add is_init test attribute of type bool. Add to_string, get, and filter methods to lib/kunit/attributes.c. Mark each of the tests in the init section with the is_init=true attribute. Add is_init to the attributes documentation. Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Rae Moar <rmoar@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/kunit/executor.c')
-rw-r--r--lib/kunit/executor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c
index 847329c51e91..717b9599036b 100644
--- a/lib/kunit/executor.c
+++ b/lib/kunit/executor.c
@@ -300,6 +300,7 @@ struct kunit_suite_set kunit_merge_suite_sets(struct kunit_suite_set init_suite_
struct kunit_suite_set total_suite_set = {NULL, NULL};
struct kunit_suite **total_suite_start = NULL;
size_t init_num_suites, num_suites, suite_size;
+ int i = 0;
init_num_suites = init_suite_set.end - init_suite_set.start;
num_suites = suite_set.end - suite_set.start;
@@ -310,8 +311,11 @@ struct kunit_suite_set kunit_merge_suite_sets(struct kunit_suite_set init_suite_
if (!total_suite_start)
return total_suite_set;
- /* Append init suites and then all other kunit suites */
+ /* Append and mark init suites and then append all other kunit suites */
memcpy(total_suite_start, init_suite_set.start, init_num_suites * suite_size);
+ for (i = 0; i < init_num_suites; i++)
+ total_suite_start[i]->is_init = true;
+
memcpy(total_suite_start + init_num_suites, suite_set.start, num_suites * suite_size);
/* Set kunit suite set start and end */