forked from kofal.net/zmk
testing: Add split BLE tests (#2737)
* Enhance the BLE test runner to build additional peripheral builds when detecting peripheral*.overlay files in the test. * Add basic and multiple-peripheral tests to exercise the testing support * Add test for triggering local behaviors on split peripherals. fix(ble): Fix building split code w/o settings * Properly exclude storing peripheral addresses to settings when settings support isn't turned on.
This commit is contained in:
1
app/tests/ble/split/basic/events.patterns
Normal file
1
app/tests/ble/split/basic/events.patterns
Normal file
@@ -0,0 +1 @@
|
||||
s/^d_02: @[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9] .{19}/profile 0 /p
|
||||
1
app/tests/ble/split/basic/nrf52_bsim.conf
Normal file
1
app/tests/ble/split/basic/nrf52_bsim.conf
Normal file
@@ -0,0 +1 @@
|
||||
CONFIG_ZMK_SPLIT=y
|
||||
19
app/tests/ble/split/basic/nrf52_bsim.keymap
Normal file
19
app/tests/ble/split/basic/nrf52_bsim.keymap
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
|
||||
&kscan {
|
||||
/delete-property/ exit-after;
|
||||
events = <>;
|
||||
};
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&kp A &kp B
|
||||
&bt BT_SEL 0 &bt BT_CLR>;
|
||||
};
|
||||
};
|
||||
};
|
||||
12
app/tests/ble/split/basic/peripheral.overlay
Normal file
12
app/tests/ble/split/basic/peripheral.overlay
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
|
||||
&kscan {
|
||||
events =
|
||||
<ZMK_MOCK_RELEASE(0,0,5000)
|
||||
ZMK_MOCK_PRESS(0,0,5000)
|
||||
ZMK_MOCK_RELEASE(0,0,200)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_RELEASE(0,1,2000)>;
|
||||
};
|
||||
2
app/tests/ble/split/basic/siblings.txt
Normal file
2
app/tests/ble/split/basic/siblings.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
./ble_test_central.exe -d=2
|
||||
./tests_ble_split_basic_peripheral.exe -d=3
|
||||
23
app/tests/ble/split/basic/snapshot.log
Normal file
23
app/tests/ble/split/basic/snapshot.log
Normal file
@@ -0,0 +1,23 @@
|
||||
profile 0 <wrn> bt_id: No static addresses stored in controller
|
||||
profile 0 <dbg> ble_central: main: [Bluetooth initialized]
|
||||
profile 0 <dbg> ble_central: start_scan: [Scanning successfully started]
|
||||
profile 0 <dbg> ble_central: device_found: [DEVICE]: FD:9E:B2:48:47:39 (random), AD evt type 0, AD data len 15, RSSI -56
|
||||
profile 0 <dbg> ble_central: eir_found: [AD]: 25 data_len 2
|
||||
profile 0 <dbg> ble_central: eir_found: [AD]: 1 data_len 1
|
||||
profile 0 <dbg> ble_central: eir_found: [AD]: 2 data_len 4
|
||||
profile 0 <dbg> ble_central: connected: [Connected]: FD:9E:B2:48:47:39 (random)
|
||||
profile 0 <dbg> ble_central: connected: [Setting the security for the connection]
|
||||
profile 0 <dbg> ble_central: pairing_complete: Pairing complete
|
||||
profile 0 <dbg> ble_central: discover_conn: [Discovery started for conn]
|
||||
profile 0 <dbg> ble_central: discover_func: [ATTRIBUTE] handle 23
|
||||
profile 0 <dbg> ble_central: discover_func: [ATTRIBUTE] handle 28
|
||||
profile 0 <dbg> ble_central: discover_func: [ATTRIBUTE] handle 30
|
||||
profile 0 <dbg> ble_central: discover_func: [SUBSCRIBED]
|
||||
profile 0 <dbg> ble_central: notify_func: payload
|
||||
profile 0 00 00 04 00 00 00 00 00 |........
|
||||
profile 0 <dbg> ble_central: notify_func: payload
|
||||
profile 0 00 00 00 00 00 00 00 00 |........
|
||||
profile 0 <dbg> ble_central: notify_func: payload
|
||||
profile 0 00 00 05 00 00 00 00 00 |........
|
||||
profile 0 <dbg> ble_central: notify_func: payload
|
||||
profile 0 00 00 00 00 00 00 00 00 |........
|
||||
Reference in New Issue
Block a user