summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-03-17 13:57:42 +1100
committerDamien George <damien@micropython.org>2023-03-23 13:18:52 +1100
commit6c7624896063e58f67d732b5f080e96f36bc5eda (patch)
treef41ae6bdcc079bcf0f02ea4ba6409109906a087f
parentaf426348661d2b6c3f6bbbdf6ae493f505ddee01 (diff)
tests/multi_bluetooth: Use multitest.output_metric in BLE perf tests.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/multi_bluetooth/perf_gatt_char_write.py2
-rw-r--r--tests/multi_bluetooth/perf_gatt_notify.py2
-rw-r--r--tests/multi_bluetooth/perf_gatt_notify.py.exp5
-rw-r--r--tests/multi_bluetooth/perf_l2cap.py2
-rw-r--r--tests/multi_bluetooth/perf_l2cap.py.exp4
5 files changed, 12 insertions, 3 deletions
diff --git a/tests/multi_bluetooth/perf_gatt_char_write.py b/tests/multi_bluetooth/perf_gatt_char_write.py
index 00607f009..681fc052c 100644
--- a/tests/multi_bluetooth/perf_gatt_char_write.py
+++ b/tests/multi_bluetooth/perf_gatt_char_write.py
@@ -128,7 +128,7 @@ def instance1():
ticks_end = time.ticks_ms()
ticks_total = time.ticks_diff(ticks_end, ticks_start)
- print(
+ multitest.output_metric(
"Did {} writes in {} ms. {} ms/write, {} bytes/sec".format(
_NUM_NOTIFICATIONS,
ticks_total,
diff --git a/tests/multi_bluetooth/perf_gatt_notify.py b/tests/multi_bluetooth/perf_gatt_notify.py
index 88986dda3..8acccc647 100644
--- a/tests/multi_bluetooth/perf_gatt_notify.py
+++ b/tests/multi_bluetooth/perf_gatt_notify.py
@@ -90,7 +90,7 @@ def instance0():
ticks_end = time.ticks_ms()
ticks_total = time.ticks_diff(ticks_end, ticks_start)
- print(
+ multitest.output_metric(
"Acknowledged {} notifications in {} ms. {} ms/notification.".format(
_NUM_NOTIFICATIONS, ticks_total, ticks_total // _NUM_NOTIFICATIONS
)
diff --git a/tests/multi_bluetooth/perf_gatt_notify.py.exp b/tests/multi_bluetooth/perf_gatt_notify.py.exp
index e69de29bb..5a4385530 100644
--- a/tests/multi_bluetooth/perf_gatt_notify.py.exp
+++ b/tests/multi_bluetooth/perf_gatt_notify.py.exp
@@ -0,0 +1,5 @@
+--- instance0 ---
+gap_advertise
+gap_disconnect: True
+--- instance1 ---
+gap_connect
diff --git a/tests/multi_bluetooth/perf_l2cap.py b/tests/multi_bluetooth/perf_l2cap.py
index 0603a02a8..a95385423 100644
--- a/tests/multi_bluetooth/perf_l2cap.py
+++ b/tests/multi_bluetooth/perf_l2cap.py
@@ -134,7 +134,7 @@ def instance1():
ble.l2cap_disconnect(conn_handle, cid)
wait_for_event(_IRQ_L2CAP_DISCONNECT, TIMEOUT_MS)
- print(
+ multitest.output_metric(
"Received {}/{} bytes in {} ms. {} B/s".format(
recv_bytes, recv_correct, total_ticks, recv_bytes * 1000 // total_ticks
)
diff --git a/tests/multi_bluetooth/perf_l2cap.py.exp b/tests/multi_bluetooth/perf_l2cap.py.exp
index e69de29bb..5e4b7a755 100644
--- a/tests/multi_bluetooth/perf_l2cap.py.exp
+++ b/tests/multi_bluetooth/perf_l2cap.py.exp
@@ -0,0 +1,4 @@
+--- instance0 ---
+
+--- instance1 ---
+