diff options
| author | Damien George <damien@micropython.org> | 2025-09-23 16:54:45 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-10-20 13:59:31 +1100 |
| commit | ea2fdebce29f655fcae7b79214b063618e26ab69 (patch) | |
| tree | 6f7850d1f7a31bce0695a66aeb79176565b3760d /tests/run-tests.py | |
| parent | 196a8653a24abe26d474899570398426877c7563 (diff) | |
tests/run-tests.py: Allow port:<dev> specification in run-multitests.py.
This moves the `port:<dev>` check for the test instance to the
`convert_device_shortcut_to_real_device()` helper function, which means
that `run-multitests.py` can use this specification.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/run-tests.py')
| -rwxr-xr-x | tests/run-tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/run-tests.py b/tests/run-tests.py index 0e38f1986..b55bd8e49 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -343,7 +343,9 @@ def platform_to_port(platform): def convert_device_shortcut_to_real_device(device): - if device.startswith("a") and device[1:].isdigit(): + if device.startswith("port:"): + return device.split(":", 1)[1] + elif device.startswith("a") and device[1:].isdigit(): return "/dev/ttyACM" + device[1:] elif device.startswith("u") and device[1:].isdigit(): return "/dev/ttyUSB" + device[1:] @@ -354,9 +356,7 @@ def convert_device_shortcut_to_real_device(device): def get_test_instance(test_instance, baudrate, user, password): - if test_instance.startswith("port:"): - _, port = test_instance.split(":", 1) - elif test_instance == "unix": + if test_instance == "unix": return None elif test_instance == "webassembly": return PyboardNodeRunner() |
