diff options
| author | Simon Glass <[email protected]> | 2025-01-20 14:26:02 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-24 14:34:41 -0600 |
| commit | 6d97c98095a11ca104a8ea7a560469ae7e2c2bd0 (patch) | |
| tree | 91cb260343ddd955b05442f5b529a3128554e26b /test | |
| parent | 15c39587cf8a977df33aba37715b6ce3e17536d7 (diff) | |
test: Record and show the totals for all test runs
With 'ut all' multiple test suites are run. Add a way to collect totals
and show them at the end.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/cmd_ut.c | 1 | ||||
| -rw-r--r-- | test/test-main.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 80df954694f..0b8bfe603b9 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -206,6 +206,7 @@ static int do_ut_all(struct unit_test_state *uts, struct cmd_tbl *cmdtp, any_fail = retval; } } + ut_report(&uts->total, uts->run_count); return any_fail; } diff --git a/test/test-main.c b/test/test-main.c index d02ab791b5a..22b9b46d9cd 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -694,6 +694,8 @@ int ut_run_list(struct unit_test_state *uts, const char *category, bool has_dm_tests = false; int ret; + memset(&uts->cur, '\0', sizeof(struct ut_stats)); + if (!CONFIG_IS_ENABLED(OF_PLATDATA) && ut_list_has_dm_tests(tests, count, prefix, select_name)) { has_dm_tests = true; @@ -734,5 +736,10 @@ int ut_run_list(struct unit_test_state *uts, const char *category, if (ret == -ENOENT) printf("Test '%s' not found\n", select_name); + uts->total.skip_count += uts->cur.skip_count; + uts->total.fail_count += uts->cur.fail_count; + uts->total.test_count += uts->cur.test_count; + uts->run_count++; + return ret; } |
