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 <sjg@chromium.org>
diff --git a/test/test-main.c b/test/test-main.c
index d02ab79..22b9b46 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -694,6 +694,8 @@
 	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 @@
 	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;
 }