From 08db645d812cc4f5758527fb674403eeeef28a2c Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Tue, 9 Aug 2022 22:06:26 -0600 Subject: [PATCH] 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 --- subsys/testsuite/ztest/src/ztest_new.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subsys/testsuite/ztest/src/ztest_new.c b/subsys/testsuite/ztest/src/ztest_new.c index 2a59e5fa2e8..6b7aca84cf4 100644 --- a/subsys/testsuite/ztest/src/ztest_new.c +++ b/subsys/testsuite/ztest/src/ztest_new.c @@ -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