summaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-02-07 11:30:36 -0700
committerTom Rini <[email protected]>2025-02-11 20:10:58 -0600
commitb85df267e1f9f6f53086875975b8e4b24570365d (patch)
tree7304d4ff74aecbcc0f913afd8e3c7bd4f3d49842 /include/test
parent5f6a59e03eff0f29295ce12b3807cbac7334e0aa (diff)
test: Show the average time per test
Show the average duration of a test, so we can keep track of how it is trending. Report the suite with the longest average test to encourage people to improve it. Add a function to update the stats based on the results from a single suite and another to show the summary information. Make this optional, since sandbox's SPL tests do not have a timer driver and people may want to print results without times. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/test.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/test/test.h b/include/test/test.h
index 25c7712d160..877fda8d5aa 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -33,6 +33,8 @@ struct ut_stats {
* @cur: Statistics for the current run
* @total: Statistics for all test runs
* @run_count: Number of times ut_run_list() has been called
+ * @worst: Sute which had the first per-text run time
+ * @worst_ms: Time taken by that test
* @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)
@@ -56,6 +58,8 @@ struct unit_test_state {
struct ut_stats cur;
struct ut_stats total;
int run_count;
+ const struct suite *worst;
+ int worst_ms;
struct mallinfo start;
struct device_node *of_root;
bool of_live;