From 0925659a5226ee70dab8b4d3e9c8aba9ec586548 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 20 Jan 2025 14:25:59 -0700 Subject: test: Move stats into a struct Use a struct to hold the stats, since we also want to have the same stats for all runs as we have for each suite. Signed-off-by: Simon Glass --- include/test/test.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/test') diff --git a/include/test/test.h b/include/test/test.h index 21c0478befe..bc8f0bbe501 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -9,11 +9,21 @@ #include #include -/* - * struct unit_test_state - Entire state of test system +/** + * struct ut_stats - Statistics about tests run * * @fail_count: Number of tests that failed * @skip_count: Number of tests that were skipped + */ +struct ut_stats { + int fail_count; + int skip_count; +}; + +/* + * struct unit_test_state - Entire state of test system + * + * @cur: Statistics for the current run * @start: Store the starting mallinfo when doing leak test * @of_live: true to use livetree if available, false to use flattree * @of_root: Record of the livetree root node (used for setting up tests) @@ -34,8 +44,7 @@ * @actual_str: Temporary string used to hold actual string value */ struct unit_test_state { - int fail_count; - int skip_count; + struct ut_stats cur; struct mallinfo start; struct device_node *of_root; bool of_live; -- cgit v1.2.3