summaryrefslogtreecommitdiff
path: root/tools/tinytest-codegen.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-12-14 12:26:59 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-12-14 12:26:59 +0200
commit325d0fc74ba9634f89f6535210944ccdd635a995 (patch)
tree93ae677869233562275f80d68b558e4e0db94fdf /tools/tinytest-codegen.py
parent64bb32d87f35531fc003493af9b4f526b19e68f3 (diff)
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.
Diffstat (limited to 'tools/tinytest-codegen.py')
-rwxr-xr-xtools/tinytest-codegen.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/tinytest-codegen.py b/tools/tinytest-codegen.py
index c6ba1867a..5339972cd 100755
--- a/tools/tinytest-codegen.py
+++ b/tools/tinytest-codegen.py
@@ -87,14 +87,14 @@ output = []
tests = []
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()
-if not args.target:
+if not args.stdin:
for group in test_dirs:
tests += [test for test in glob('{}/*.py'.format(group)) if test not in exclude_tests]
else:
- for l in os.popen("./run-tests --list-tests --target=%s" % args.target, "r"):
+ for l in sys.stdin:
tests.append(l.rstrip())
output.extend([test_function.format(**script_to_map(test)) for test in tests])