9
9
import os , re
10
10
env = pioutil .env
11
11
12
- os .environ [" PATH" ] = f"./buildroot/bin/:./buildroot/tests/:{ os .environ ['PATH' ]} "
12
+ os .environ [' PATH' ] = f"./buildroot/bin/:./buildroot/tests/:{ os .environ ['PATH' ]} "
13
13
14
14
def collect_test_suites ():
15
15
"""Get all the test suites"""
@@ -21,36 +21,38 @@ def register_test_suites():
21
21
targets = []
22
22
test_suites = collect_test_suites ()
23
23
for path in test_suites :
24
- name = re .sub (r" ^\d+-|\.ini$" , "" , path .name )
25
- targets += [name ]
24
+ name = re .sub (r' ^\d+-|\.ini$' , '' , path .name )
25
+ targets += [name ];
26
26
27
27
env .AddCustomTarget (
28
- name = f"marlin_{ name } " ,
29
- dependencies = None ,
30
- actions = [
28
+ name = f"marlin_{ name } " ,
29
+ dependencies = None ,
30
+ actions = [
31
31
f"echo ====== Configuring for marlin_{ name } ======" ,
32
32
"restore_configs" ,
33
33
f"cp -f { path } ./Marlin/config.ini" ,
34
34
"python ./buildroot/share/PlatformIO/scripts/configuration.py" ,
35
35
f"platformio test -e linux_native_test -f { name } " ,
36
36
"restore_configs" ,
37
37
],
38
- title = "Marlin: {}" .format (name .lower ().title ().replace ("_" , " " )),
39
- description = (
38
+ title = "Marlin: {}" .format (name .lower ().title ().replace ("_" , " " )),
39
+ description = (
40
40
f"Run a Marlin test suite, with the appropriate configuration, "
41
41
f"that sits in { path } "
42
42
)
43
43
)
44
44
45
45
env .AddCustomTarget (
46
- name = "test-marlin" ,
47
- dependencies = None ,
48
- actions = [
46
+ name = "test-marlin" ,
47
+ dependencies = None ,
48
+ actions = [
49
49
f"platformio run -t marlin_{ name } -e linux_native_test"
50
50
for name in targets
51
51
],
52
- title = "Marlin: Test all code test suites" ,
53
- description = (f"Run all Marlin code test suites ({ len (targets )} found)." )
52
+ title = "Marlin: Test all code test suites" ,
53
+ description = (
54
+ f"Run all Marlin code test suites ({ len (targets )} found)."
55
+ ),
54
56
)
55
57
56
58
register_test_suites ()
0 commit comments