Skip to content
Snippets Groups Projects
Commit 325d0fc7 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tools/tinytest-codegen: Add --stdin switch instead of recently added --target.

Instead of passing thru more and more options from tinytest-codegen to
run-tests --list-tests, pipe output of run-tests --list-tests into
tinytest-codegen.
parent 64bb32d8
No related branches found
No related tags found
No related merge requests found
...@@ -87,14 +87,14 @@ output = [] ...@@ -87,14 +87,14 @@ output = []
tests = [] tests = []
argparser = argparse.ArgumentParser(description='Convert native MicroPython tests to tinytest/upytesthelper C code') argparser = argparse.ArgumentParser(description='Convert native MicroPython tests to tinytest/upytesthelper C code')
argparser.add_argument('--target', help='the target platform') argparser.add_argument('--stdin', action="store_true", help='read list of tests from stdin')
args = argparser.parse_args() args = argparser.parse_args()
if not args.target: if not args.stdin:
for group in test_dirs: for group in test_dirs:
tests += [test for test in glob('{}/*.py'.format(group)) if test not in exclude_tests] tests += [test for test in glob('{}/*.py'.format(group)) if test not in exclude_tests]
else: else:
for l in os.popen("./run-tests --list-tests --target=%s" % args.target, "r"): for l in sys.stdin:
tests.append(l.rstrip()) tests.append(l.rstrip())
output.extend([test_function.format(**script_to_map(test)) for test in tests]) output.extend([test_function.format(**script_to_map(test)) for test in tests])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment