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 <damien@micropython.org>
This commit is contained in:
Damien George 2021-04-30 10:12:04 +10:00
parent 888664130c
commit 76dab3bf31
1 changed files with 10 additions and 0 deletions

View File

@ -160,7 +160,17 @@ class PyInstanceSubProcess(PyInstance):
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()