Bluetooth: Controller: Test for user extensions
With pull request #16208 and #16404 hooks for calling user defined code was implemented. These user extensions are gated by a number of Kconfigs. The test in this pull request tests that code compiles when these Kconfigs are enabled. Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
This commit is contained in:
parent
aec04a02ed
commit
912e117e9e
5 changed files with 88 additions and 0 deletions
12
tests/bluetooth/ctrl_user_ext/CMakeLists.txt
Normal file
12
tests/bluetooth/ctrl_user_ext/CMakeLists.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.13.1)
|
||||
include_directories("./src")
|
||||
|
||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||
project(bluetooth_ctrl_user_ext)
|
||||
|
||||
|
||||
FILE(GLOB app_sources src/*.c)
|
||||
|
||||
target_sources(app PRIVATE ${app_sources})
|
10
tests/bluetooth/ctrl_user_ext/prj.conf
Normal file
10
tests/bluetooth/ctrl_user_ext/prj.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
CONFIG_BT=y
|
||||
CONFIG_BT_CTLR=y
|
||||
CONFIG_BT_LL_SW_SPLIT=y
|
||||
CONFIG_BT_PERIPHERAL=y
|
||||
CONFIG_BT_CENTRAL=y
|
||||
CONFIG_ZTEST=y
|
||||
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
|
||||
CONFIG_BT_CTLR_USER_EXT=y
|
||||
CONFIG_BT_CTLR_USER_EVT_RANGE=10
|
||||
CONFIG_BT_RX_USER_PDU_LEN=7
|
27
tests/bluetooth/ctrl_user_ext/src/main.c
Normal file
27
tests/bluetooth/ctrl_user_ext/src/main.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* main.c - Application main entry point */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015-2016 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/types.h>
|
||||
#include <stddef.h>
|
||||
#include <misc/printk.h>
|
||||
#include <ztest.h>
|
||||
|
||||
#include <bluetooth/bluetooth.h>
|
||||
|
||||
void test_ctrl_user_ext(void)
|
||||
{
|
||||
zassert_false(bt_enable(NULL), "Bluetooth ctrl_user_ext failed");
|
||||
}
|
||||
|
||||
/*test case main entry*/
|
||||
void test_main(void)
|
||||
{
|
||||
ztest_test_suite(test_bluetooth,
|
||||
ztest_unit_test(test_ctrl_user_ext));
|
||||
ztest_run_test_suite(test_bluetooth);
|
||||
}
|
33
tests/bluetooth/ctrl_user_ext/src/ull_vendor.h
Normal file
33
tests/bluetooth/ctrl_user_ext/src/ull_vendor.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Oticon A/S
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_USER_EXT)
|
||||
|
||||
/* The test is made to show that ull.c and other code can compile when
|
||||
* certain Kconfig options are set. This includes functions that are
|
||||
* used for vendor specific behavior, as such the function implementations
|
||||
* in this file are simple stubs without functional behavior.
|
||||
*/
|
||||
|
||||
static inline int ull_user_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int rx_demux_rx_proprietary(memq_link_t *link,
|
||||
struct node_rx_hdr *rx,
|
||||
memq_link_t *tail,
|
||||
memq_link_t **head)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ull_proprietary_done(struct node_rx_event_done *evdone)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BT_CTLR_USER_EXT */
|
6
tests/bluetooth/ctrl_user_ext/testcase.yaml
Normal file
6
tests/bluetooth/ctrl_user_ext/testcase.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
common:
|
||||
build_only: true
|
||||
tags: bluetooth
|
||||
tests:
|
||||
bluetooth.ctrl_user_ext.test:
|
||||
platform_whitelist: nrf52_bsim
|
Loading…
Add table
Add a link
Reference in a new issue