From cfeb325b4fbd60e4161110b1401e091fcce3b728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Battrel?= Date: Tue, 27 Aug 2024 13:13:08 +0200 Subject: [PATCH] Tests: Shell: Take into account startup new line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update `shell_backend_uart` to take into account the new line print by `z_cursor_next_line_move`. Signed-off-by: Théo Battrel --- tests/subsys/shell/shell_backend_uart/src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/subsys/shell/shell_backend_uart/src/main.c b/tests/subsys/shell/shell_backend_uart/src/main.c index 2aa6d794608..1bb87567cf6 100644 --- a/tests/subsys/shell/shell_backend_uart/src/main.c +++ b/tests/subsys/shell/shell_backend_uart/src/main.c @@ -110,6 +110,7 @@ SHELL_DEFINE(shell_euart0, "", &shell_transport_euart0, static void *setup(void) { + uint8_t tx_content[SAMPLE_DATA_SIZE] = {0}; static struct shell_backend_uart_fixture fixture = { .dev = DEVICE_DT_GET(DT_NODELABEL(euart0)), }; @@ -120,6 +121,10 @@ static void *setup(void) /* Let the shell backend initialize. */ k_usleep(10); + /* get the shell startup newline */ + uart_emul_get_tx_data(fixture.dev, tx_content, SAMPLE_DATA_SIZE); + zassert_mem_equal(tx_content, "\r\n", strlen("\r\n")); + return &fixture; }