summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2014-05-28 14:27:54 +0200
committerstijn <stinos@zoho.com>2014-05-28 14:33:30 +0200
commit8ac3b578e5ec913d9a596e500a6c202794e34ba1 (patch)
tree5dbaa1e6ad875cf86035e705423cdd3c0216642d
parentae13758dd756b53a0265c1834601648ddb36fda3 (diff)
downloadmicropython-8ac3b578e5ec913d9a596e500a6c202794e34ba1.tar.gz
micropython-8ac3b578e5ec913d9a596e500a6c202794e34ba1.zip
tests: Add argument to allow specifying which directories to test
-rwxr-xr-xtests/run-tests15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/run-tests b/tests/run-tests
index 102655abea..1a79bdc093 100755
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -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()
@@ -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