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
@@ -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()
