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 */