Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tests: Add argument to allow specifying which directories to test #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions tests/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def run_tests(pyb, tests):
def main():
cmd_parser = argparse.ArgumentParser(description='Run tests for Micro Python.')
cmd_parser.add_argument('--pyboard', action='store_true', help='run the tests on the pyboard')
cmd_parser.add_argument('-d', '--test_dirs', nargs='*', help='input test directories (if no files given)')
cmd_parser.add_argument('files', nargs='*', help='input test files')
args = cmd_parser.parse_args()

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

if len(args.files) == 0:
if pyb is None:
# run PC tests
test_dirs = ('basics', 'micropython', 'float', 'import', 'io', 'misc')
if args.test_dirs is None:
if pyb is None:
# run PC tests
test_dirs = ('basics', 'micropython', 'float', 'import', 'io', 'misc')
else:
# run pyboard tests
test_dirs = ('basics', 'float', 'pyb', 'pybnative', 'inlineasm')
else:
# run pyboard tests
test_dirs = ('basics', 'float', 'pyb', 'pybnative', 'inlineasm')
# run tests from these directories
test_dirs = args.test_dirs
tests = sorted(test_file for test_files in (glob('{}/*.py'.format(dir)) for dir in test_dirs) for test_file in test_files)
else:
# tests explicitly given
Expand Down