Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
/tests/lib/ble_adv/ @nrfconnect/ncs-bm-test
/tests/lib/bm_storage/ @nrfconnect/ncs-bm
/tests/lib/bm_timer/ @nrfconnect/ncs-bm @nrfconnect/ncs-bm-test
/tests/subsys/bluetooth/services/ble_bas/ @nrfconnect/ncs-bm @nrfconnect/ncs-bm-test

# Zephyr module
/zephyr/ @nrfconnect/ncs-co-build-system
Expand Down
37 changes: 37 additions & 0 deletions tests/subsys/bluetooth/services/ble_bas/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(unit_test_ble_bas)

set(SOFTDEVICE_VARIANT "s115")
set(SOFTDEVICE_INCLUDE_DIR "${ZEPHYR_NRF_BM_MODULE_DIR}/components/softdevice/\
${SOFTDEVICE_VARIANT}/${SOFTDEVICE_VARIANT}_API/include")

cmock_handle(${SOFTDEVICE_INCLUDE_DIR}/ble_gatts.h)

target_compile_definitions(app PRIVATE
NRF54L15_XXAA
SVCALL_AS_NORMAL_FUNCTION
SUPPRESS_INLINE_IMPLEMENTATION
CONFIG_NRF_SDH_BLE_TOTAL_LINK_COUNT=1
)

target_include_directories(app PRIVATE
${SOFTDEVICE_INCLUDE_DIR}
${ZEPHYR_NRF_BM_MODULE_DIR}/include
${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk
)

# Generate and add test file
test_runner_generate(src/unity_test.c)
target_sources(app PRIVATE src/unity_test.c)

# Unit under test
target_sources(app PRIVATE ${ZEPHYR_NRF_BM_MODULE_DIR}/subsys/bluetooth/services/ble_bas/bas.c)
6 changes: 6 additions & 0 deletions tests/subsys/bluetooth/services/ble_bas/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_UNITY=y
Loading