Skip to content

Commit 7c80d40

Browse files
tests: zbus: add multidomain UART backend test suite
Add comprehensive test suite for the zbus multidomain UART backend. The implementation uses UART emulator devices to enable testing without requiring physical UART hardware. Signed-off-by: Trond F. Christiansen <[email protected]>
1 parent f4afb05 commit 7c80d40

File tree

5 files changed

+534
-0
lines changed

5 files changed

+534
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
cmake_minimum_required(VERSION 3.20.0)
3+
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(test_channel_name)
6+
7+
FILE(GLOB app_sources src/main.c)
8+
target_sources(app PRIVATE ${app_sources})
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2023 Meta
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
euart0: uart-emul0 {
9+
compatible = "zephyr,uart-emul";
10+
status = "okay";
11+
current-speed = <0>;
12+
rx-fifo-size = <256>;
13+
tx-fifo-size = <256>;
14+
};
15+
euart1: uart-emul1 {
16+
compatible = "zephyr,uart-emul";
17+
status = "okay";
18+
current-speed = <0>;
19+
rx-fifo-size = <512>;
20+
tx-fifo-size = <512>;
21+
};
22+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CONFIG_ZTEST=y
2+
CONFIG_ASSERT=n
3+
CONFIG_LOG=y
4+
CONFIG_ZBUS=y
5+
CONFIG_EMUL=y
6+
CONFIG_ZBUS_CHANNEL_ID=y
7+
CONFIG_ZBUS_CHANNEL_NAME=y
8+
CONFIG_ZBUS_MULTIDOMAIN=y
9+
CONFIG_ZBUS_MULTIDOMAIN_UART=y
10+
11+
CONFIG_UART_ASYNC_API=y
12+
CONFIG_SERIAL=y
13+
CONFIG_ZBUS_MULTIDOMAIN_LOG_LEVEL_DBG=n
14+
15+
# Retransmission configuration for faster testing
16+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_ACK_TIMEOUT=10
17+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_ACK_TIMEOUT_MAX=100
18+
CONFIG_ZBUS_MULTIDOMAIN_MAX_TRANSMIT_ATTEMPTS=5
19+
20+
# Increase message pool size for testing multiple scenarios
21+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_POOL_SIZE=16
22+
23+
# FFF (Fake Function Framework) for mocking
24+
CONFIG_ZTEST_MOCKING=y
25+
26+
# IPC service support
27+
CONFIG_IPC_SERVICE=y
28+
CONFIG_MBOX=y

0 commit comments

Comments
 (0)