Skip to content

Commit 9996adc

Browse files
committed
tests/run-tests: Add cmd line option "--heapsize".
This allows you to specify the heapsize that unix will use when running the test suite, eg: ./run-tests --heapsize 16k
1 parent cea6cf8 commit 9996adc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/run-tests

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ def run_micropython(pyb, args, test_file):
140140
else:
141141
# a standard test
142142
try:
143-
output_mupy = subprocess.check_output([MICROPYTHON, '-X', 'emit=' + args.emit, test_file])
143+
cmdlist = [MICROPYTHON, '-X', 'emit=' + args.emit]
144+
if args.heapsize is not None:
145+
cmdlist.extend(['-X', 'heapsize=' + args.heapsize])
146+
cmdlist.append(test_file)
147+
output_mupy = subprocess.check_output(cmdlist)
144148
except subprocess.CalledProcessError:
145149
output_mupy = b'CRASH'
146150
else:
@@ -344,6 +348,7 @@ def main():
344348
cmd_parser.add_argument('-d', '--test-dirs', nargs='*', help='input test directories (if no files given)')
345349
cmd_parser.add_argument('--write-exp', action='store_true', help='save .exp files to run tests w/o CPython')
346350
cmd_parser.add_argument('--emit', default='bytecode', help='MicroPython emitter to use (bytecode or native)')
351+
cmd_parser.add_argument('--heapsize', help='heapsize to use (use default if not specified)')
347352
cmd_parser.add_argument('files', nargs='*', help='input test files')
348353
args = cmd_parser.parse_args()
349354

0 commit comments

Comments
 (0)