diff --git a/src/include/sof/boot_test.h b/src/include/sof/boot_test.h index dfa8671ee55f..fd4fd3df03bd 100644 --- a/src/include/sof/boot_test.h +++ b/src/include/sof/boot_test.h @@ -38,6 +38,18 @@ struct k_thread; void sof_run_boot_tests(void); +/** + * ZTEST_SUITE() predicate for standalone test suites that run themselves + * from a SYS_INIT hook with ztest_run_test_suite(). That call does not + * check the predicate, but ztest_run_all() in sof_run_boot_tests() does, + * so the suite is not run a second time. + */ +static inline bool sof_boot_test_standalone_predicate(const void *state) +{ + (void)state; + return false; +} + /** * Mark a boot-test thread as expected to trigger a fatal error. * diff --git a/zephyr/test/userspace/test_intel_hda_dma.c b/zephyr/test/userspace/test_intel_hda_dma.c index 064cb2b115c0..ac434ce2e9ab 100644 --- a/zephyr/test/userspace/test_intel_hda_dma.c +++ b/zephyr/test/userspace/test_intel_hda_dma.c @@ -280,7 +280,7 @@ ZTEST(userspace_intel_hda_dma, dma_mem_to_host) ztest_test_pass(); } -ZTEST_SUITE(userspace_intel_hda_dma, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(userspace_intel_hda_dma, sof_boot_test_standalone_predicate, NULL, NULL, NULL, NULL); /** * SOF main has booted up and IPC handling is stopped. diff --git a/zephyr/test/userspace/test_intel_ssp_dai.c b/zephyr/test/userspace/test_intel_ssp_dai.c index 6c700c3839bb..fc9d2b4bd356 100644 --- a/zephyr/test/userspace/test_intel_ssp_dai.c +++ b/zephyr/test/userspace/test_intel_ssp_dai.c @@ -333,7 +333,7 @@ ZTEST(userspace_intel_dai_ssp, dai_ssp_loopback_setup) ztest_test_pass(); } -ZTEST_SUITE(userspace_intel_dai_ssp, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(userspace_intel_dai_ssp, sof_boot_test_standalone_predicate, NULL, NULL, NULL, NULL); /** * SOF main has booted up and IPC handling is stopped. diff --git a/zephyr/test/userspace/test_ll_task.c b/zephyr/test/userspace/test_ll_task.c index f6a63b7194bd..2599ce0ec859 100644 --- a/zephyr/test/userspace/test_ll_task.c +++ b/zephyr/test/userspace/test_ll_task.c @@ -130,7 +130,7 @@ ZTEST(userspace_ll, pipeline_check) pipeline_check(); } -ZTEST_SUITE(userspace_ll, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(userspace_ll, sof_boot_test_standalone_predicate, NULL, NULL, NULL, NULL); /** * SOF main has booted up and IPC handling is stopped. diff --git a/zephyr/test/userspace/test_mailbox.c b/zephyr/test/userspace/test_mailbox.c index 766dababb553..64ef3075014f 100644 --- a/zephyr/test/userspace/test_mailbox.c +++ b/zephyr/test/userspace/test_mailbox.c @@ -88,7 +88,7 @@ ZTEST(userspace_mailbox, mailbox_test) ztest_test_pass(); } -ZTEST_SUITE(userspace_mailbox, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(userspace_mailbox, sof_boot_test_standalone_predicate, NULL, NULL, NULL, NULL); /** * SOF main has booted up and IPC handling is stopped.