update_stats(uts, ste);
}
}
- ut_report(&uts->total, uts->run_count);
return any_fail;
}
{
struct unit_test_state uts;
struct suite *ste;
- const char *name;
+ char *name;
int ret;
if (argc < 2)
} else if (!strcmp(name, "info")) {
ret = do_ut_info(cmdtp, flag, argc, argv);
} else {
- ste = find_suite(argv[0]);
- if (!ste) {
- printf("Suite '%s' not found\n", argv[0]);
- return CMD_RET_FAILURE;
- } else if (!has_tests(ste)) {
- /* perhaps a Kconfig option needs to be set? */
- printf("Suite '%s' is not enabled\n", argv[0]);
- return CMD_RET_FAILURE;
- }
+ int any_fail = 0;
+ const char *p;
+
+ for (; p = strsep(&name, ","), p; name = NULL) {
+ ste = find_suite(p);
+ if (!ste) {
+ printf("Suite '%s' not found\n", p);
+ return CMD_RET_FAILURE;
+ } else if (!has_tests(ste)) {
+ /* perhaps a Kconfig option needs to be set? */
+ printf("Suite '%s' is not enabled\n", p);
+ return CMD_RET_FAILURE;
+ }
- ret = run_suite(&uts, ste, cmdtp, flag, argc, argv);
+ ret = run_suite(&uts, ste, cmdtp, flag, argc, argv);
+ if (!any_fail)
+ any_fail = ret;
+ update_stats(&uts, ste);
+ }
+ ret = any_fail;
}
show_stats(&uts);
if (ret)
assert suite_count == len(EXPECTED_SUITES)
assert total_test_count == len(all_tests)
+
+ # Run three suites
+ with cons.log.section('Check multiple suites'):
+ output = cons.run_command('ut bloblist,setexpr,mem')
+ assert 'Suites run: 3' in output
void ut_report(struct ut_stats *stats, int run_count)
{
if (run_count > 1)
- printf("Total tests");
+ printf("Suites run: %d, total tests", run_count);
else
printf("Tests");
printf(" run: %d, ", stats->test_count);