summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-12-22 23:51:57 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-27 12:30:51 +1100
commit865827ed8e423cd89309b8bdd45a13902de56c4e (patch)
treef1775e9dd56d19d41d98365244449bf95ab73a8c
parentab75210e3338fbcc975b3c04e047ac553690f429 (diff)
tests/run-tests: Add "--mpy-cross-flags" arg to specify mpy-cross flags.
-rwxr-xr-xtests/run-tests3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/run-tests b/tests/run-tests
index 77667c271..789a6f06c 100755
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -130,7 +130,7 @@ def run_micropython(pyb, args, test_file, is_special=False):
# if running via .mpy, first compile the .py file
if args.via_mpy:
- subprocess.check_output([MPYCROSS, '-mcache-lookup-bc', '-o', 'mpytest.mpy', '-X', 'emit=' + args.emit, test_file])
+ subprocess.check_output([MPYCROSS] + args.mpy_cross_flags.split() + ['-o', 'mpytest.mpy', '-X', 'emit=' + args.emit, test_file])
cmdlist.extend(['-m', 'mpytest'])
else:
cmdlist.append(test_file)
@@ -566,6 +566,7 @@ the last matching regex is used:
cmd_parser.add_argument('--emit', default='bytecode', help='MicroPython emitter to use (bytecode or native)')
cmd_parser.add_argument('--heapsize', help='heapsize to use (use default if not specified)')
cmd_parser.add_argument('--via-mpy', action='store_true', help='compile .py files to .mpy first')
+ cmd_parser.add_argument('--mpy-cross-flags', default='-mcache-lookup-bc', help='flags to pass to mpy-cross')
cmd_parser.add_argument('--keep-path', action='store_true', help='do not clear MICROPYPATH when running tests')
cmd_parser.add_argument('files', nargs='*', help='input test files')
args = cmd_parser.parse_args()