@@ -32,6 +32,12 @@ def script_to_map(test_file):
3232 return r
3333
3434
35+ def load_profile (profile_file , test_dirs , exclude_tests ):
36+ profile_globals = {"test_dirs" : test_dirs , "exclude_tests" : exclude_tests }
37+ exec (profile_file .read (), profile_globals )
38+ return profile_globals ["test_dirs" ], profile_globals ["exclude_tests" ]
39+
40+
3541test_function = (
3642 "void {name}(void* data) {{\n "
3743 " static const char pystr[] = {script};\n "
@@ -50,58 +56,55 @@ def script_to_map(test_file):
5056testgroup_member = ' {{ "{name}", {name}_tests }},'
5157
5258## XXX: may be we could have `--without <groups>` argument...
53- # currently these tests are selected because they pass on qemu-arm
54- test_dirs = (
55- "basics" ,
56- "micropython" ,
57- "misc" ,
58- "extmod" ,
59- "float" ,
60- "inlineasm" ,
61- "qemu-arm" ,
62- ) # 'import', 'io',)
63- exclude_tests = (
64- # pattern matching in .exp
65- "basics/bytes_compare3.py" ,
66- "extmod/ticks_diff.py" ,
67- "extmod/time_ms_us.py" ,
68- # unicode char issue
69- "extmod/json_loads.py" ,
70- # doesn't output to python stdout
71- "extmod/re_debug.py" ,
72- "extmod/vfs_basic.py" ,
73- "extmod/vfs_fat_ramdisk.py" ,
74- "extmod/vfs_fat_fileio.py" ,
75- "extmod/vfs_fat_fsusermount.py" ,
76- "extmod/vfs_fat_oldproto.py" ,
77- # rounding issues
78- "float/float_divmod.py" ,
79- # requires double precision floating point to work
80- "float/float2int_doubleprec_intbig.py" ,
81- "float/float_format_ints_doubleprec.py" ,
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- # needs sys stdfiles
97- "misc/print_exception.py" ,
98- # settrace .exp files are too large
99- "misc/sys_settrace_loop.py" ,
100- "misc/sys_settrace_generator.py" ,
101- "misc/sys_settrace_features.py" ,
102- # don't have f-string
103- "basics/string_fstring.py" ,
104- "basics/string_fstring_debug.py" ,
59+
60+ test_dirs = set (
61+ (
62+ "basics" ,
63+ "extmod" ,
64+ "float" ,
65+ "micropython" ,
66+ "misc" ,
67+ )
68+ )
69+
70+ exclude_tests = set (
71+ (
72+ # pattern matching in .exp
73+ "basics/bytes_compare3.py" ,
74+ "extmod/ticks_diff.py" ,
75+ "extmod/time_ms_us.py" ,
76+ # unicode char issue
77+ "extmod/json_loads.py" ,
78+ # doesn't output to python stdout
79+ "extmod/re_debug.py" ,
80+ "extmod/vfs_basic.py" ,
81+ "extmod/vfs_fat_ramdisk.py" ,
82+ "extmod/vfs_fat_fileio.py" ,
83+ "extmod/vfs_fat_fsusermount.py" ,
84+ "extmod/vfs_fat_oldproto.py" ,
85+ # rounding issues
86+ "float/float_divmod.py" ,
87+ # requires double precision floating point to work
88+ "float/float2int_doubleprec_intbig.py" ,
89+ "float/float_format_ints_doubleprec.py" ,
90+ "float/float_parse_doubleprec.py" ,
91+ # different filename in output
92+ "micropython/emg_exc.py" ,
93+ "micropython/heapalloc_traceback.py" ,
94+ # don't have emergency exception buffer
95+ "micropython/heapalloc_exc_compressed_emg_exc.py" ,
96+ # pattern matching in .exp
97+ "micropython/meminfo.py" ,
98+ # needs sys stdfiles
99+ "misc/print_exception.py" ,
100+ # settrace .exp files are too large
101+ "misc/sys_settrace_loop.py" ,
102+ "misc/sys_settrace_generator.py" ,
103+ "misc/sys_settrace_features.py" ,
104+ # don't have f-string
105+ "basics/string_fstring.py" ,
106+ "basics/string_fstring_debug.py" ,
107+ )
105108)
106109
107110output = []
@@ -112,11 +115,18 @@ def script_to_map(test_file):
112115)
113116argparser .add_argument ("--stdin" , action = "store_true" , help = "read list of tests from stdin" )
114117argparser .add_argument ("--exclude" , action = "append" , help = "exclude test by name" )
118+ argparser .add_argument (
119+ "--profile" ,
120+ type = argparse .FileType ("rt" , encoding = "utf-8" ),
121+ help = "optional profile file providing test directories and exclusion list" ,
122+ )
115123args = argparser .parse_args ()
116124
117125if not args .stdin :
126+ if args .profile :
127+ test_dirs , exclude_tests = load_profile (args .profile , test_dirs , exclude_tests )
118128 if args .exclude :
119- exclude_tests += tuple (args .exclude )
129+ exclude_tests = exclude_tests . union (args .exclude )
120130 for group in test_dirs :
121131 tests += [test for test in glob ("{}/*.py" .format (group )) if test not in exclude_tests ]
122132else :
0 commit comments