mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
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
This commit is contained in:
parent
cea6cf8a5e
commit
9996adc37d
@ -140,7 +140,11 @@ def run_micropython(pyb, args, test_file):
|
|||||||
else:
|
else:
|
||||||
# a standard test
|
# a standard test
|
||||||
try:
|
try:
|
||||||
output_mupy = subprocess.check_output([MICROPYTHON, '-X', 'emit=' + args.emit, test_file])
|
cmdlist = [MICROPYTHON, '-X', 'emit=' + args.emit]
|
||||||
|
if args.heapsize is not None:
|
||||||
|
cmdlist.extend(['-X', 'heapsize=' + args.heapsize])
|
||||||
|
cmdlist.append(test_file)
|
||||||
|
output_mupy = subprocess.check_output(cmdlist)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
output_mupy = b'CRASH'
|
output_mupy = b'CRASH'
|
||||||
else:
|
else:
|
||||||
@ -344,6 +348,7 @@ def main():
|
|||||||
cmd_parser.add_argument('-d', '--test-dirs', nargs='*', help='input test directories (if no files given)')
|
cmd_parser.add_argument('-d', '--test-dirs', nargs='*', help='input test directories (if no files given)')
|
||||||
cmd_parser.add_argument('--write-exp', action='store_true', help='save .exp files to run tests w/o CPython')
|
cmd_parser.add_argument('--write-exp', action='store_true', help='save .exp files to run tests w/o CPython')
|
||||||
cmd_parser.add_argument('--emit', default='bytecode', help='MicroPython emitter to use (bytecode or native)')
|
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('files', nargs='*', help='input test files')
|
cmd_parser.add_argument('files', nargs='*', help='input test files')
|
||||||
args = cmd_parser.parse_args()
|
args = cmd_parser.parse_args()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user