From b85689ba42f52f4e414be5e36e2b144ef3bf423e Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Thu, 20 Jan 2022 06:55:19 +0100 Subject: [PATCH] testsuite: tc_util: Flush logs before posix_exit Flush all logs before terminating test in posix. Signed-off-by: Krzysztof Chruscinski --- subsys/testsuite/include/tc_util.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/testsuite/include/tc_util.h b/subsys/testsuite/include/tc_util.h index 7066259d75d..beb0425b1b3 100644 --- a/subsys/testsuite/include/tc_util.h +++ b/subsys/testsuite/include/tc_util.h @@ -16,6 +16,7 @@ #include #endif #include +#include #if defined CONFIG_ZTEST_TC_UTIL_USER_OVERRIDE #include @@ -174,7 +175,10 @@ static inline void test_time_ms(void) #endif #if defined(CONFIG_ARCH_POSIX) -#define TC_END_POST(result) posix_exit(result) +#define TC_END_POST(result) do { \ + LOG_PANIC(); \ + posix_exit(result); \ +} while (0) #else #define TC_END_POST(result) #endif /* CONFIG_ARCH_POSIX */