From e98ff3f08e966595fd84d83296f84962ee3d8d94 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 12 Mar 2021 19:50:13 +1100 Subject: [PATCH] tests/multi_bluetooth: Skip tests when BLE features are unsupported. Signed-off-by: Damien George --- tests/multi_bluetooth/ble_gap_pair.py | 4 ++++ tests/multi_bluetooth/ble_gap_pair_bond.py | 4 ++++ tests/multi_bluetooth/ble_l2cap.py | 4 ++++ tests/multi_bluetooth/perf_l2cap.py | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/tests/multi_bluetooth/ble_gap_pair.py b/tests/multi_bluetooth/ble_gap_pair.py index 728513405e..f10fa37074 100644 --- a/tests/multi_bluetooth/ble_gap_pair.py +++ b/tests/multi_bluetooth/ble_gap_pair.py @@ -4,6 +4,10 @@ from micropython import const import time, machine, bluetooth +if not hasattr(bluetooth.BLE, "gap_pair"): + print("SKIP") + raise SystemExit + TIMEOUT_MS = 4000 _IRQ_CENTRAL_CONNECT = const(1) diff --git a/tests/multi_bluetooth/ble_gap_pair_bond.py b/tests/multi_bluetooth/ble_gap_pair_bond.py index a29c217887..d7224cc127 100644 --- a/tests/multi_bluetooth/ble_gap_pair_bond.py +++ b/tests/multi_bluetooth/ble_gap_pair_bond.py @@ -5,6 +5,10 @@ from micropython import const import time, machine, bluetooth +if not hasattr(bluetooth.BLE, "gap_pair"): + print("SKIP") + raise SystemExit + TIMEOUT_MS = 4000 _IRQ_CENTRAL_CONNECT = const(1) diff --git a/tests/multi_bluetooth/ble_l2cap.py b/tests/multi_bluetooth/ble_l2cap.py index a26f59b3ef..b14eeffcc5 100644 --- a/tests/multi_bluetooth/ble_l2cap.py +++ b/tests/multi_bluetooth/ble_l2cap.py @@ -7,6 +7,10 @@ from micropython import const import time, machine, bluetooth, random +if not hasattr(bluetooth.BLE, "l2cap_connect"): + print("SKIP") + raise SystemExit + TIMEOUT_MS = 1000 _IRQ_CENTRAL_CONNECT = const(1) diff --git a/tests/multi_bluetooth/perf_l2cap.py b/tests/multi_bluetooth/perf_l2cap.py index 9b07bb1dce..0603a02a81 100644 --- a/tests/multi_bluetooth/perf_l2cap.py +++ b/tests/multi_bluetooth/perf_l2cap.py @@ -3,6 +3,10 @@ from micropython import const import time, machine, bluetooth, random +if not hasattr(bluetooth.BLE, "l2cap_connect"): + print("SKIP") + raise SystemExit + TIMEOUT_MS = 1000 _IRQ_CENTRAL_CONNECT = const(1)