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
25 changes: 17 additions & 8 deletions tests/bluetooth/audio/bap_broadcast_source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr COMPONENTS unittest HINTS $ENV{ZEPHYR_BASE})
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(bluetooth_bap_broadcast_source)

add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/audio/bap_broadcast_source/uut uut)
target_include_directories(app PRIVATE ${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/include)

target_link_libraries(testbinary PRIVATE uut)
target_sources(app PRIVATE
# Test source files
src/main.c
src/test_callback_register.c

target_include_directories(testbinary PRIVATE include)
# Stack source file
${ZEPHYR_BASE}/subsys/bluetooth/audio/audio.c
${ZEPHYR_BASE}/subsys/bluetooth/audio/bap_iso.c
${ZEPHYR_BASE}/subsys/bluetooth/audio/bap_stream.c
${ZEPHYR_BASE}/subsys/bluetooth/audio/bap_broadcast_source.c
${ZEPHYR_BASE}/subsys/bluetooth/audio/codec.c

target_sources(testbinary
PRIVATE
src/main.c
src/test_callback_register.c
# Mock files
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/src/bap_broadcast_source.c
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/src/bap_stream.c
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/src/conn.c
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/src/iso.c
)
36 changes: 36 additions & 0 deletions tests/bluetooth/audio/bap_broadcast_source/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0


config BT_AUDIO
bool
default y

config BT_BUF_EVT_RX_COUNT
int
default 10

config BT_BUF_ACL_TX_COUNT
int
default 5

config BT_ISO_BROADCASTER
bool
default y

config BT_ISO_MAX_BIG
int
default 10

config BT_ISO_MAX_CHAN
int
default 10

config BT_LOG
bool
default y

# Include Zephyr's Kconfig.
source "Kconfig"
source "subsys/bluetooth/audio/Kconfig"
source "subsys/bluetooth/Kconfig.logging"
11 changes: 6 additions & 5 deletions tests/bluetooth/audio/bap_broadcast_source/prj.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
CONFIG_ZTEST=y

CONFIG_BT=y
CONFIG_BT_AUDIO=y

CONFIG_BT_ISO_BROADCASTER=y
CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_NET_BUF=y

CONFIG_BT_BAP_BROADCAST_SOURCE=y
CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=2
CONFIG_BT_BAP_BROADCAST_SRC_COUNT=1
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=2

CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE=20
CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=20
CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE=20
CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=20

CONFIG_LOG=y
CONFIG_BT_BAP_BROADCAST_SOURCE_LOG_LEVEL_DBG=y

Expand Down
4 changes: 2 additions & 2 deletions tests/bluetooth/audio/bap_broadcast_source/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#include <zephyr/net_buf.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/ztest_assert.h>
#include <zephyr/ztest_test.h>

#include "bap_broadcast_source.h"
#include "bap_stream.h"
#include "bluetooth.h"
#include "expects_util.h"
#include "ztest_assert.h"
#include "ztest_test.h"

DEFINE_FFF_GLOBALS;

Expand Down
5 changes: 4 additions & 1 deletion tests/bluetooth/audio/bap_broadcast_source/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ common:
- bluetooth_audio
tests:
bluetooth.audio.bap_broadcast_source.test_default:
type: unit
platform_allow:
- native_sim
integration_platforms:
- native_sim
24 changes: 0 additions & 24 deletions tests/bluetooth/audio/bap_broadcast_source/uut/CMakeLists.txt

This file was deleted.