From 76dab3bf31617e707a874a6c0dfc49af97640980 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 30 Apr 2021 10:12:04 +1000 Subject: [PATCH] tests/run-multitests.py: Provide some convenient serial device shorcuts. It's now possible to specify a device serial port using shorcuts like: $ ./run-multitests.py -i pyb:a0 -i pyb:u1 multi_bluetooth/*.py Signed-off-by: Damien George --- tests/run-multitests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/run-multitests.py b/tests/run-multitests.py index cdb2730edabb..3163a48e63d2 100755 --- a/tests/run-multitests.py +++ b/tests/run-multitests.py @@ -160,7 +160,17 @@ def wait_finished(self): class PyInstancePyboard(PyInstance): + @staticmethod + def map_device_shortcut(device): + if device[0] == "a" and device[1:].isdigit(): + return "/dev/ttyACM" + device[1:] + elif device[0] == "u" and device[1:].isdigit(): + return "/dev/ttyUSB" + device[1:] + else: + return device + def __init__(self, device): + device = self.map_device_shortcut(device) self.device = device self.pyb = pyboard.Pyboard(device) self.pyb.enter_raw_repl()