Skip to content

Commit 331ad7e

Browse files
committed
[#91106] parser: Discover test modules dynamically
Adds `http_echo` and `spi`, which were missed earlier.
1 parent fe0d37d commit 331ad7e

File tree

1 file changed

+5
-50
lines changed

1 file changed

+5
-50
lines changed

protoplaster/conf/parser.py

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,15 @@
66

77
import yaml
88

9-
from protoplaster.tests.i2c.test import __file__ as i2c_test
10-
from protoplaster.tests.gpio.gpio.test import __file__ as gpio_test
11-
from protoplaster.tests.camera.test import __file__ as camera_test
12-
from protoplaster.tests.fpga.test import __file__ as fpga_test
13-
from protoplaster.tests.network.test import __file__ as network_test
14-
from protoplaster.tests.adc.adc.test import __file__ as adc_test
15-
from protoplaster.tests.adc.LTC2493.test import __file__ as LTC2493_test
16-
from protoplaster.tests.adc.LTC2499.test import __file__ as LTC2499_test
17-
from protoplaster.tests.adc.ADC12DJ3200.test import __file__ as ADC12DJ3200_test
18-
from protoplaster.tests.dac.dac.test import __file__ as dac_test
19-
from protoplaster.tests.dac.ti_dac38j8x_eyescan.test import __file__ as ti_dac38j8x_eyescan_test
20-
from protoplaster.tests.dac.ti_dac38j8x_spi.test import __file__ as ti_dac38j8x_spi_test
21-
from protoplaster.tests.memtester.test import __file__ as mem_test
22-
from protoplaster.tests.dac.LTC2655.test import __file__ as LTC2655_test
23-
from protoplaster.tests.dac.LTC2657.test import __file__ as LTC2657_test
24-
from protoplaster.tests.gpio.PI4IO.test import __file__ as PI4IO_test
25-
from protoplaster.tests.pmic.DA9062.test import __file__ as DA9062_test
26-
from protoplaster.tests.pmic.UCD90320U.test import __file__ as UCD90320U_test
27-
from protoplaster.tests.clock_controller.LMK04828.test import __file__ as LMK04828_test
28-
from protoplaster.tests.thermometer.TMP431.test import __file__ as TMP431_test
29-
from protoplaster.tests.i2c_mux.TCA9548A.test import __file__ as TCA9548A_test
30-
from protoplaster.tests.usb.test import __file__ as usb_test
31-
from protoplaster.tests.simple.test import __file__ as simple_test
32-
from protoplaster.tests.http_echo.test import __file__ as http_echo_test
9+
import protoplaster.tests
3310
from protoplaster.tools.tools import pr_err, pr_info, pr_warn
3411

3512
StrPath = str | Path
3613

37-
test_modules_paths = {
38-
"i2c": i2c_test,
39-
"gpio": gpio_test,
40-
"camera": camera_test,
41-
"fpga": fpga_test,
42-
"network": network_test,
43-
"adc": adc_test,
44-
"LTC2493": LTC2493_test,
45-
"LTC2499": LTC2499_test,
46-
"ADC12DJ3200": ADC12DJ3200_test,
47-
"dac": dac_test,
48-
"LTC2655": LTC2655_test,
49-
"LTC2657": LTC2657_test,
50-
"PI4IO": PI4IO_test,
51-
"memtester": mem_test,
52-
"TMP431": TMP431_test,
53-
"DA9062": DA9062_test,
54-
"UCD90320U": UCD90320U_test,
55-
"LMK04828": LMK04828_test,
56-
"TCA9548A": TCA9548A_test,
57-
"simple": simple_test,
58-
"ti_dac38j8x_eyescan": ti_dac38j8x_eyescan_test,
59-
"ti_dac38j8x_spi": ti_dac38j8x_spi_test,
60-
"http_echo": http_echo_test,
61-
"usb": usb_test,
62-
}
14+
test_modules_paths = {}
15+
tests_root = protoplaster.tests.__path__[0]
16+
for test_path in Path(tests_root).parent.rglob("test.py"):
17+
test_modules_paths[test_path.parent.name] = str(test_path.absolute())
6318

6419

6520
def to_path(p: StrPath) -> Path:

0 commit comments

Comments
 (0)