test: Add up the number of tests manually
All tests should belong to a suite, but if there is a suite we don't know about (e.g. not added to cmd_ut.c) then the totals will not add up. Add a check for this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -233,11 +233,11 @@ static int do_ut_info(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
|
|
||||||
flags = cmd_arg1(argc, argv);
|
flags = cmd_arg1(argc, argv);
|
||||||
if (flags && !strcmp("-s", flags)) {
|
if (flags && !strcmp("-s", flags)) {
|
||||||
int i;
|
int i, total;
|
||||||
|
|
||||||
puts("\nTests Suite Purpose");
|
puts("\nTests Suite Purpose");
|
||||||
puts("\n----- ------------ -------------------------\n");
|
puts("\n----- ------------ -------------------------\n");
|
||||||
for (i = 0; i < ARRAY_SIZE(suites); i++) {
|
for (i = 0, total = 0; i < ARRAY_SIZE(suites); i++) {
|
||||||
struct suite *ste = &suites[i];
|
struct suite *ste = &suites[i];
|
||||||
long n_ent = ste->end - ste->start;
|
long n_ent = ste->end - ste->start;
|
||||||
|
|
||||||
@@ -248,7 +248,13 @@ static int do_ut_info(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
else /* suite is not present */
|
else /* suite is not present */
|
||||||
continue;
|
continue;
|
||||||
printf(" %-13.13s %s\n", ste->name, ste->help);
|
printf(" %-13.13s %s\n", ste->name, ste->help);
|
||||||
|
total += n_ent;
|
||||||
}
|
}
|
||||||
|
puts("----- ------------ -------------------------\n");
|
||||||
|
printf("%5d %-13.13s\n", total, "Total");
|
||||||
|
|
||||||
|
if (UNIT_TEST_ALL_COUNT() != total)
|
||||||
|
puts("Error: Suite test-count does not match total\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user