test/py: Add a test which runs all unit tests

Add a Python test which runs 'ut all' and then checks that the expected
suites are present and all tests in each suite are run.

This can help to check that nothing is missing.

Update 'ut info' to ignore the 'all' suite when counting the number of
suites, since that is really just a combination of all the other suites.

Adjust the message for skipped tests so that appears even if no
particular test was selected. This helps the new 'test_suite' test see
what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-01-20 14:25:31 -07:00
parent c774445f29
commit 17f4ac61ce
3 changed files with 186 additions and 5 deletions

View File

@@ -155,7 +155,7 @@ static int do_ut_info(struct cmd_tbl *cmdtp, int flag, int argc,
{
const char *flags;
printf("Test suites: %d\n", (int)ARRAY_SIZE(cmd_ut_sub));
printf("Test suites: %d\n", (int)ARRAY_SIZE(cmd_ut_sub) - 1);
printf("Total tests: %d\n", (int)UNIT_TEST_ALL_COUNT());
flags = cmd_arg1(argc, argv);