Skip to content

Commit e7412ab

Browse files
committed
Merge pull request #632 from stinos/tests-dir-argument
tests: Add argument to allow specifying which directories to test
2 parents 5b5562c + 8ac3b57 commit e7412ab

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/run-tests

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def run_tests(pyb, tests):
111111
def main():
112112
cmd_parser = argparse.ArgumentParser(description='Run tests for Micro Python.')
113113
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)')
114115
cmd_parser.add_argument('files', nargs='*', help='input test files')
115116
args = cmd_parser.parse_args()
116117

@@ -122,12 +123,16 @@ def main():
122123
pyb = None
123124

124125
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')
128133
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
131136
tests = sorted(test_file for test_files in (glob('{}/*.py'.format(dir)) for dir in test_dirs) for test_file in test_files)
132137
else:
133138
# tests explicitly given

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy