@@ -380,11 +380,17 @@ def is_included(path):
380
380
testfiles .append (testfile )
381
381
382
382
args += [_graalpytest_driver (), "-v" ]
383
- args += testfiles
384
- mx .logv (" " .join ([python_binary ] + args ))
385
383
386
384
agent_args = " " .join (mx_gate .get_jacoco_agent_args () or [])
387
- with set_env (JAVA_TOOL_OPTIONS = agent_args ):
385
+ if agent_args :
386
+ # jacoco only dumps the data on exit, and when we run all our unittests
387
+ # at once it generates so much data we run out of heap space
388
+ with set_env (JAVA_TOOL_OPTIONS = agent_args ):
389
+ for testfile in testfiles :
390
+ mx .run ([python_binary ] + args + [testfile ], nonZeroIsFatal = True )
391
+ else :
392
+ args += testfiles
393
+ mx .logv (" " .join ([python_binary ] + args ))
388
394
return mx .run ([python_binary ] + args , nonZeroIsFatal = True )
389
395
390
396
@@ -397,7 +403,7 @@ def graalpython_gate_runner(args, tasks):
397
403
# Unittests on JVM
398
404
with Task ('GraalPython Python unittests' , tasks , tags = [GraalPythonTags .unittest ]) as task :
399
405
if task :
400
- if platform .system () != 'Darwin' :
406
+ if platform .system () != 'Darwin' and not mx_gate . get_jacoco_agent_args () :
401
407
# TODO: drop condition when python3 is available on darwin
402
408
mx .log ("Running tests with CPython" )
403
409
test_args = [_graalpytest_driver (), "-v" , _graalpytest_root ()]
0 commit comments