summaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-01-20 14:25:59 -0700
committerTom Rini <[email protected]>2025-01-24 14:34:41 -0600
commit0925659a5226ee70dab8b4d3e9c8aba9ec586548 (patch)
tree652ca8bf305fdbb1263636f96a482aeacc8e0e10 /include/test
parentbbff0b165c170598c100dac81a5ee58fb07ed3ae (diff)
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 <[email protected]>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/test.h17
1 files changed, 13 insertions, 4 deletions
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 <malloc.h>
#include <linux/bitops.h>
-/*
- * 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;