ztest: prints newline after failure message
Most calls to ztest_assert() contain a message with no trailing
newline. So when it fails, we get (eg:):
starting test - test_multilib
Assertion failed at multilib.c:19: test_multilib: (c not equal to 323)
smoke-test failed: wrong multilib selectedFAIL - test_multilib.
when we'd like to get:
smoke-test failed: wrong multilib selected
FAIL - test_multilib.
among other things, because it is easier to parse for correctness.
So this patch adds a trailing newline to the message instead of going
around trying to police every call site to do it.
print[kf]() is used vs k_str_out() as we need something that is
available also for unit tests. As this is not in any hot path,
performance wise is not such a big deal.
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This commit is contained in:
parent
27d34926e5
commit
2a64fe666a
1 changed files with 2 additions and 0 deletions
|
|
@ -49,8 +49,10 @@ static inline void _zassert(int cond,
|
||||||
file, line, func, default_msg);
|
file, line, func, default_msg);
|
||||||
#if defined(CONFIG_STDOUT_CONSOLE)
|
#if defined(CONFIG_STDOUT_CONSOLE)
|
||||||
vprintf(msg, vargs);
|
vprintf(msg, vargs);
|
||||||
|
printf("\n");
|
||||||
#else
|
#else
|
||||||
vprintk(msg, vargs);
|
vprintk(msg, vargs);
|
||||||
|
printk("\n");
|
||||||
#endif
|
#endif
|
||||||
va_end(vargs);
|
va_end(vargs);
|
||||||
ztest_test_fail();
|
ztest_test_fail();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue