Skip to content

Commit a499eac

Browse files
committed
tests: unit: bluetooth: services: ble_lbs
Add unit tests for ble_lbs. Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
1 parent db32fb5 commit a499eac

5 files changed

Lines changed: 421 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
11+
project(unit_test_ble_lbs)
12+
13+
softdevice_unity_setup()
14+
15+
cmock_handle(${SOFTDEVICE_INCLUDE_DIR}/ble.h)
16+
cmock_handle(${SOFTDEVICE_INCLUDE_DIR}/ble_gatts.h)
17+
18+
# Generate and add test file
19+
test_runner_generate(src/unity_test.c)
20+
target_sources(app PRIVATE src/unity_test.c)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Redefine this symbol without dependencies, so that tests
2+
# can enable it without having to enable the dependencies too.
3+
config BLE_LBS
4+
default y
5+
6+
# Redefine Kconfigs used by the tested module that are defined in
7+
# other modules we do not want to enable.
8+
config NRF_SDH_BLE_TOTAL_LINK_COUNT
9+
default 1
10+
11+
source "Kconfig.zephyr"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_UNITY=y

0 commit comments

Comments
 (0)