tests: logging: Add a clean ouput test and clarify output

Add a new test with clean output and warn the user that the version
without clean output will output garbled text.

Fixes #23799

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2020-05-21 19:58:06 +02:00 committed by Carles Cufí
commit 855b6c1a5d
2 changed files with 9 additions and 0 deletions

View file

@ -56,6 +56,10 @@ static void thread_func(void *p1, void *p2, void *p3)
*/
static void test_log_immediate_preemption(void)
{
if (!IS_ENABLED(CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT)) {
LOG_INF("CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT not enabled."
" Text output will be garbled.");
}
for (intptr_t i = 0; i < NUM_THREADS; i++) {
tids[i] = k_thread_create(&threads[i], stacks[i], STACK_SIZE,
thread_func, (void *)i, NULL, NULL,

View file

@ -3,3 +3,8 @@ tests:
tags: log_core logging
platform_exclude: nucleo_l053r8 nucleo_f030r8
stm32f0_disco nrf52_bsim
logging.log_immediate.clean_output:
extra_args: CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT=y
tags: log_core logging
platform_exclude: nucleo_l053r8 nucleo_f030r8
stm32f0_disco nrf52_bsim