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 <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-01-20 14:25:59 -07:00
parent 5e6b79b37e
commit a4d05c0996
3 changed files with 30 additions and 20 deletions

View File

@@ -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;