Skip to content

Commit 744dd3a

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 1b9feb0 commit 744dd3a

File tree

5 files changed

+546
-0
lines changed

5 files changed

+546
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(test_channel_name)
11+
12+
FILE(GLOB app_sources src/main.c)
13+
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) 2025 Nordic Semiconductor ASA
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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_ZTEST=y
8+
CONFIG_ASSERT=n
9+
CONFIG_LOG=y
10+
CONFIG_ZBUS=y
11+
CONFIG_EMUL=y
12+
CONFIG_ZBUS_CHANNEL_ID=y
13+
CONFIG_ZBUS_CHANNEL_NAME=y
14+
CONFIG_ZBUS_MULTIDOMAIN=y
15+
CONFIG_ZBUS_MULTIDOMAIN_UART=y
16+
17+
CONFIG_UART_ASYNC_API=y
18+
CONFIG_SERIAL=y
19+
CONFIG_ZBUS_MULTIDOMAIN_LOG_LEVEL_DBG=n
20+
21+
# Retransmission configuration for faster testing
22+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_ACK_TIMEOUT=10
23+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_ACK_TIMEOUT_MAX=100
24+
CONFIG_ZBUS_MULTIDOMAIN_MAX_TRANSMIT_ATTEMPTS=5
25+
26+
# Increase message pool size for testing multiple scenarios
27+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_POOL_SIZE=16
28+
29+
# FFF (Fake Function Framework) for mocking
30+
CONFIG_ZTEST_MOCKING=y
31+
32+
# IPC service support
33+
CONFIG_IPC_SERVICE=y
34+
CONFIG_MBOX=y

0 commit comments

Comments
 (0)