testsuite: tc_util: Flush logs before posix_exit

Flush all logs before terminating test in posix.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-01-20 06:55:19 +01:00 committed by Carles Cufí
parent 07e0a5f08a
commit b85689ba42

View file

@ -16,6 +16,7 @@
#include <shell/shell.h>
#endif
#include <sys/printk.h>
#include <logging/log_ctrl.h>
#if defined CONFIG_ZTEST_TC_UTIL_USER_OVERRIDE
#include <tc_util_user_override.h>
@ -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 */