Skip to content

Commit 325d0fc

Browse files
committed
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.
1 parent 64bb32d commit 325d0fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/tinytest-codegen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ def script_to_map(test_file):
8787
tests = []
8888

8989
argparser = argparse.ArgumentParser(description='Convert native MicroPython tests to tinytest/upytesthelper C code')
90-
argparser.add_argument('--target', help='the target platform')
90+
argparser.add_argument('--stdin', action="store_true", help='read list of tests from stdin')
9191
args = argparser.parse_args()
9292

93-
if not args.target:
93+
if not args.stdin:
9494
for group in test_dirs:
9595
tests += [test for test in glob('{}/*.py'.format(group)) if test not in exclude_tests]
9696
else:
97-
for l in os.popen("./run-tests --list-tests --target=%s" % args.target, "r"):
97+
for l in sys.stdin:
9898
tests.append(l.rstrip())
9999

100100
output.extend([test_function.format(**script_to_map(test)) for test in tests])

0 commit comments

Comments
 (0)