Navigation Menu

Skip to content

Commit

Permalink
tests/run-multitests.py: Provide some convenient serial device shorcuts.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dpgeorge committed Apr 30, 2021
1 parent 8886641 commit 76dab3b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/run-multitests.py
Expand Up @@ -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()
Expand Down

0 comments on commit 76dab3b

Please sign in to comment.