ztest: move end_report implementation

Move the implementation of end_report so it can be used by both code
paths (with and without KERNEL).

Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
Yuval Peress 2022-08-09 22:06:26 -06:00 committed by Carles Cufí
commit 08db645d81

View file

@ -55,6 +55,15 @@ static ZTEST_BMEM int test_status;
extern ZTEST_DMEM const struct ztest_arch_api ztest_api;
void end_report(void)
{
if (test_status) {
TC_END_REPORT(TC_FAIL);
} else {
TC_END_REPORT(TC_PASS);
}
}
static int cleanup_test(struct ztest_unit_test *test)
{
int ret = TC_PASS;
@ -665,15 +674,6 @@ int z_ztest_run_test_suite(const char *name)
return z_ztest_run_test_suite_ptr(ztest_find_test_suite(name));
}
void end_report(void)
{
if (test_status) {
TC_END_REPORT(TC_FAIL);
} else {
TC_END_REPORT(TC_PASS);
}
}
#ifdef CONFIG_USERSPACE
K_APPMEM_PARTITION_DEFINE(ztest_mem_partition);
#endif