@@ -111,6 +111,7 @@ def run_tests(pyb, tests):
111
111
def main ():
112
112
cmd_parser = argparse .ArgumentParser (description = 'Run tests for Micro Python.' )
113
113
cmd_parser .add_argument ('--pyboard' , action = 'store_true' , help = 'run the tests on the pyboard' )
114
+ cmd_parser .add_argument ('-d' , '--test_dirs' , nargs = '*' , help = 'input test directories (if no files given)' )
114
115
cmd_parser .add_argument ('files' , nargs = '*' , help = 'input test files' )
115
116
args = cmd_parser .parse_args ()
116
117
@@ -122,12 +123,16 @@ def main():
122
123
pyb = None
123
124
124
125
if len (args .files ) == 0 :
125
- if pyb is None :
126
- # run PC tests
127
- test_dirs = ('basics' , 'micropython' , 'float' , 'import' , 'io' , 'misc' )
126
+ if args .test_dirs is None :
127
+ if pyb is None :
128
+ # run PC tests
129
+ test_dirs = ('basics' , 'micropython' , 'float' , 'import' , 'io' , 'misc' )
130
+ else :
131
+ # run pyboard tests
132
+ test_dirs = ('basics' , 'float' , 'pyb' , 'pybnative' , 'inlineasm' )
128
133
else :
129
- # run pyboard tests
130
- test_dirs = ( 'basics' , 'float' , 'pyb' , 'pybnative' , 'inlineasm' )
134
+ # run tests from these directories
135
+ test_dirs = args . test_dirs
131
136
tests = sorted (test_file for test_files in (glob ('{}/*.py' .format (dir )) for dir in test_dirs ) for test_file in test_files )
132
137
else :
133
138
# tests explicitly given
0 commit comments