@@ -50,17 +50,17 @@ def script_to_map(test_file):
50
50
testgroup_member = ' {{ "{name}", {name}_tests }},'
51
51
52
52
## XXX: may be we could have `--without <groups>` argument...
53
- # currently these tests are selected because they pass on qemu-arm
54
- test_dirs = (
53
+
54
+ # Common test directories and tests exclusion list
55
+
56
+ common_test_directories = (
55
57
"basics" ,
56
- "micropython" ,
57
- "misc" ,
58
58
"extmod" ,
59
59
"float" ,
60
- "inlineasm " ,
61
- "qemu-arm" ,
62
- ) # 'import', 'io',)
63
- exclude_tests = (
60
+ "misc " ,
61
+ )
62
+
63
+ common_excluded_tests = (
64
64
# pattern matching in .exp
65
65
"basics/bytes_compare3.py" ,
66
66
"extmod/ticks_diff.py" ,
@@ -80,19 +80,6 @@ def script_to_map(test_file):
80
80
"float/float2int_doubleprec_intbig.py" ,
81
81
"float/float_format_ints_doubleprec.py" ,
82
82
"float/float_parse_doubleprec.py" ,
83
- # inline asm FP tests (require Cortex-M4)
84
- "inlineasm/asmfpaddsub.py" ,
85
- "inlineasm/asmfpcmp.py" ,
86
- "inlineasm/asmfpldrstr.py" ,
87
- "inlineasm/asmfpmuldiv.py" ,
88
- "inlineasm/asmfpsqrt.py" ,
89
- # different filename in output
90
- "micropython/emg_exc.py" ,
91
- "micropython/heapalloc_traceback.py" ,
92
- # don't have emergency exception buffer
93
- "micropython/heapalloc_exc_compressed_emg_exc.py" ,
94
- # pattern matching in .exp
95
- "micropython/meminfo.py" ,
96
83
# needs sys stdfiles
97
84
"misc/print_exception.py" ,
98
85
# settrace .exp files are too large
@@ -104,6 +91,30 @@ def script_to_map(test_file):
104
91
"basics/string_fstring_debug.py" ,
105
92
)
106
93
94
+ # Port-specific test directories and tests exclusion list
95
+
96
+ port_test_directories = {
97
+ "qemu-arm" : ("inlineasm" , "micropython" , "qemu-arm" ),
98
+ }
99
+
100
+ port_tests_exclusion_lists = {
101
+ "qemu-arm" : (
102
+ # inline asm FP tests (require Cortex-M4)
103
+ "inlineasm/asmfpaddsub.py" ,
104
+ "inlineasm/asmfpcmp.py" ,
105
+ "inlineasm/asmfpldrstr.py" ,
106
+ "inlineasm/asmfpmuldiv.py" ,
107
+ "inlineasm/asmfpsqrt.py" ,
108
+ # different filename in output
109
+ "micropython/emg_exc.py" ,
110
+ "micropython/heapalloc_traceback.py" ,
111
+ # don't have emergency exception buffer
112
+ "micropython/heapalloc_exc_compressed_emg_exc.py" ,
113
+ # pattern matching in .exp
114
+ "micropython/meminfo.py" ,
115
+ )
116
+ }
117
+
107
118
output = []
108
119
tests = []
109
120
@@ -112,8 +123,13 @@ def script_to_map(test_file):
112
123
)
113
124
argparser .add_argument ("--stdin" , action = "store_true" , help = "read list of tests from stdin" )
114
125
argparser .add_argument ("--exclude" , action = "append" , help = "exclude test by name" )
126
+ argparser .add_argument ("--port" , help = "optional MicroPython port name to generate tests for" )
115
127
args = argparser .parse_args ()
116
128
129
+ port_name = args .port .lower () if args .port else None
130
+ test_dirs = common_test_directories + port_test_directories .get (port_name , ())
131
+ exclude_tests = common_excluded_tests + port_tests_exclusion_lists .get (port_name , ())
132
+
117
133
if not args .stdin :
118
134
if args .exclude :
119
135
exclude_tests += tuple (args .exclude )
0 commit comments