diff --git a/tests/src/lv_test_init.c b/tests/src/lv_test_init.c index 035d9de1e..7048843ca 100644 --- a/tests/src/lv_test_init.c +++ b/tests/src/lv_test_init.c @@ -10,6 +10,7 @@ static void hal_init(void); static void dummy_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p); +static void test_log_print_cb(lv_log_level_t level, const char * buf); uint8_t * last_flushed_buf; lv_indev_t * lv_test_mouse_indev; @@ -19,6 +20,14 @@ lv_indev_t * lv_test_encoder_indev; void lv_test_init(void) { lv_init(); + + lv_log_register_print_cb(test_log_print_cb); + +#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN + /* Disable profiler, to reduce redundant profiler log printing */ + lv_profiler_builtin_set_enable(false); +#endif + hal_init(); #if LV_USE_SYSMON #if LV_USE_MEM_MONITOR @@ -76,6 +85,15 @@ static void dummy_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t lv_display_flush_ready(disp); } +static void test_log_print_cb(lv_log_level_t level, const char * buf) +{ + if(level < LV_LOG_LEVEL_WARN) { + return; + } + + TEST_PRINTF("%s", buf); +} + void lv_test_assert_fail(void) { /*Handle error on test*/