@@ -382,7 +382,10 @@ def is_included(path):
382
382
args += [_graalpytest_driver (), "-v" ]
383
383
args += testfiles
384
384
mx .logv (" " .join ([python_binary ] + args ))
385
- return mx .run ([python_binary ] + args , nonZeroIsFatal = True )
385
+
386
+ agent_args = " " .join (mx_gate .get_jacoco_agent_args () or [])
387
+ with set_env (JAVA_TOOL_OPTIONS = agent_args ):
388
+ return mx .run ([python_binary ] + args , nonZeroIsFatal = True )
386
389
387
390
388
391
def graalpython_gate_runner (args , tasks ):
@@ -1202,8 +1205,6 @@ def mx_post_parse_cmd_line(namespace):
1202
1205
1203
1206
def python_coverage (args ):
1204
1207
"Generate coverage report for our unittests"
1205
- os .system ("which lcov" )
1206
- os .system ("which genhtml" )
1207
1208
parser = ArgumentParser (prog = 'mx python-coverage' )
1208
1209
parser .add_argument ('--jacoco' , action = 'store_true' , help = 'do generate Jacoco coverage' )
1209
1210
parser .add_argument ('--truffle' , action = 'store_true' , help = 'do generate Truffle coverage' )
@@ -1213,15 +1214,21 @@ def python_coverage(args):
1213
1214
if args .jacoco :
1214
1215
jacoco_args = [
1215
1216
'--jacoco-whitelist-package' , 'com.oracle.graal.python' ,
1216
- # '--jacoco-exclude-annotation', '@GeneratedBy',
1217
1217
]
1218
+ jacoco_gates = (
1219
+ GraalPythonTags .junit ,
1220
+ GraalPythonTags .unittest ,
1221
+ GraalPythonTags .unittest_multi ,
1222
+ GraalPythonTags .unittest_jython ,
1223
+ GraalPythonTags .tagged ,
1224
+ )
1218
1225
mx .run_mx (jacoco_args + [
1219
1226
'--strict-compliance' ,
1220
1227
'--dynamicimports' , '/compiler' ,
1221
1228
'--primary' , 'gate' ,
1222
1229
'-B=--force-deprecation-as-warning-for-dependencies' ,
1223
1230
'--strict-mode' ,
1224
- '--tags' , 'python-unittest,python-tagged-unittest,python-junit' ,
1231
+ '--tags' , "," . join ([ '%s' ] * len ( jacoco_gates )) % jacoco_gates ,
1225
1232
'--jacocout' , 'html' ,
1226
1233
])
1227
1234
if mx .get_env ("SONAR_HOST_URL" , None ):
0 commit comments