Skip to content

Commit 6b35fa3

Browse files
committed
Introduce 'mptest list-tentacles' and 'mprest list-tests'
1 parent 0cd5afe commit 6b35fa3

File tree

2 files changed

+57
-23
lines changed

2 files changed

+57
-23
lines changed

.vscode/launch.json

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,28 @@
4040
"justMyCode": false,
4141
},
4242
{
43-
"name": "mptest list",
43+
"name": "mptest list-tentacles",
4444
"type": "debugpy",
4545
"request": "launch",
4646
"module": "testbed_micropython.mptest.cli",
4747
"cwd": "${workspaceFolder}",
4848
"args": [
49-
"list",
49+
"list-tentacles",
50+
],
51+
"console": "integratedTerminal",
52+
"env": {
53+
"PYDEVD_DISABLE_FILE_VALIDATION": "1",
54+
},
55+
"justMyCode": false,
56+
},
57+
{
58+
"name": "mptest list-tests",
59+
"type": "debugpy",
60+
"request": "launch",
61+
"module": "testbed_micropython.mptest.cli",
62+
"cwd": "${workspaceFolder}",
63+
"args": [
64+
"list-tests",
5065
],
5166
"console": "integratedTerminal",
5267
"env": {
@@ -110,30 +125,38 @@
110125
// "--only-board=RPI_PICO_W",
111126
// "--only-board=ESP32_S3_DEVKIT",
112127
// "--only-board=ESP32_C3_DEVKIT",
128+
// "--only-board=ESP32_DEVKIT",
113129
// "--only-board=RPI_PICO2",
114-
// "--skip-board=LOLIN_D1_MINI", // ESP8266_GENERIC
115-
"--testresults=${workspaceFolder}/testresults",
130+
// "--only-board=PYBV11",
131+
// "--only-board=LOLIN_D1_MINI", // ESP8266_GENERIC
132+
// "--only-test=RUN-MULTITESTS_MULTIBLUETOOTH",
116133
// "--only-test=RUN-MULTITESTS_MULTINET",
117134
// "--only-test=RUN-TESTS_NET_INET",
118135
// "--only-test=RUN-TESTS_STANDARD",
119136
// "--only-test=RUN-TESTS_STANDARD_NATIVE",
137+
// "--only-test=RUN-TESTS_STANDARD_VIA_MPY",
120138
// "--only-test=RUN-TESTS_EXTMOD_HARDWARE",
139+
// "--only-test=RUN-FLASH_FORMAT",
121140
// "--only-test=RUN-TESTS_STANDARD_NATIVE",
122141
// "--only-test=RUN-TESTS_STANDARD",
123142
// "--skip-test=RUN-TESTS_STANDARD",
124143
// "--only-test=RUN-TESTS_STANDARD:run-tests.py --via-mpy --test-dirs=micropython",
125144
// "--only-test=RUN-TESTS_STANDARD:run-tests.py --test-dirs=micropython",
126145
// "--only-board=LOLIN_D1_MINI",
127146
// "--skip-test=RUN-MULTITESTS_MULTINET",
128-
// "--only-test=RUN-MULTITESTS_MULTINET",
147+
"--only-test=RUN-NATMODTESTS",
148+
// "--only-board=LOLIN_C3_MINI",
149+
// "--only-board=LOLIN_D1_MINI",
129150
// "--only-fut=FUT_WLAN",
130-
"--skip-fut=FUT_WLAN",
131-
"--skip-fut=FUT_BLE",
132-
"--no-multiprocessing",
151+
// "--skip-fut=FUT_WLAN",
152+
// "--skip-fut=FUT_BLE",
153+
// "--no-multiprocessing",
133154
// "--flash-force",
134155
"--flash-skip",
156+
// "--count=24",
135157
// "--no-git-clean",
136158
// "--debug-skip-tests",
159+
// "--debug-skip-usb-error",
137160
],
138161
"console": "integratedTerminal",
139162
"env": {

src/testbed_micropython/mptest/cli.py

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,25 @@ def debugbootmode(
109109
do_debugbootmode(programmer=programmer)
110110

111111

112-
@app.command(name="list", help="List tests and connected tentacles")
113-
def list_() -> None:
112+
@app.command(help="List supportet tests")
113+
def list_tests() -> None:
114+
# args = util_testrunner.Args.get_default_args()
115+
# testrunner = util_testrunner.TestRunner(args=args)
116+
init_logging()
117+
for testrun_spec in util_testrunner.get_testrun_specs():
118+
print(f" {testrun_spec.label}")
119+
print(f" help={testrun_spec.helptext}")
120+
print(f" executable={testrun_spec.command_executable}")
121+
print(f" args={testrun_spec.command_args}")
122+
print(f" required_fut={testrun_spec.required_fut.name}")
123+
print(f" tests_todo={testrun_spec.tests_todo}")
124+
print(" tests")
125+
for tsv in testrun_spec.tsvs_todo:
126+
print(f" {tsv}")
127+
128+
129+
@app.command(help="List connected tentacles")
130+
def list_tentacles() -> None:
114131
# args = util_testrunner.Args.get_default_args()
115132
# testrunner = util_testrunner.TestRunner(args=args)
116133
init_logging()
@@ -124,24 +141,18 @@ def list_() -> None:
124141
print("Connected")
125142
for tentacle in connected_tentacles:
126143
print(f" {tentacle.label}")
144+
print(
145+
f" infra: {tentacle.infra.usb_location_infra} {tentacle.infra.usb_tentacle.pico_infra.serial_port}"
146+
)
147+
print(
148+
f" dut: {tentacle.infra.usb_location_dut} {tentacle.infra.usb_tentacle.usb_port_dut.device_text}"
149+
)
150+
127151
variants = ",".join(tentacle.tentacle_spec.board_build_variants)
128152
print(f" variants={variants}")
129153
futs = ",".join([fut.name for fut in tentacle.tentacle_spec.futs])
130154
print(f" futs={futs}")
131155

132-
print("")
133-
print("Tests")
134-
for testrun_spec in util_testrunner.get_testrun_specs():
135-
print(f" {testrun_spec.label}")
136-
print(f" help={testrun_spec.helptext}")
137-
print(f" executable={testrun_spec.command_executable}")
138-
print(f" args={testrun_spec.command_args}")
139-
print(f" required_fut={testrun_spec.required_fut.name}")
140-
print(f" tests_todo={testrun_spec.tests_todo}")
141-
print(" tests")
142-
for tsv in testrun_spec.tsvs_todo:
143-
print(f" {tsv}")
144-
145156

146157
@app.command(help="Flashes all tentacles without running any tests")
147158
def flash(

0 commit comments

Comments
 (0)