@@ -1215,37 +1215,39 @@ def mx_post_parse_cmd_line(namespace):
1215
1215
1216
1216
def python_coverage (args ):
1217
1217
"Generate coverage report for our unittests"
1218
+ os .system ("which lcov" )
1219
+ os .system ("which genhtml" )
1218
1220
parser = ArgumentParser (prog = 'mx python-coverage' )
1219
1221
parser .add_argument ('--jacoco' , action = 'store_true' , help = 'do generate Jacoco coverage' )
1220
1222
parser .add_argument ('--truffle' , action = 'store_true' , help = 'do generate Truffle coverage' )
1221
1223
parser .add_argument ('--truffle-upload-url' , help = 'Format is like rsync: user@host:/directory' , default = None )
1222
1224
args = parser .parse_args (args )
1223
1225
1224
- # if args.jacoco:
1225
- # jacoco_args = [
1226
- # '--jacoco-whitelist-package', 'com.oracle.graal.python',
1227
- # # '--jacoco-exclude-annotation', '@GeneratedBy',
1228
- # ]
1229
- # mx.run_mx(jacoco_args + [
1230
- # '--strict-compliance',
1231
- # '--dynamicimports', '/compiler',
1232
- # '--primary', 'gate',
1233
- # '-B=--force-deprecation-as-warning-for-dependencies',
1234
- # '--strict-mode',
1235
- # '--tags', 'python-unittest,python-tagged-unittest,python-junit',
1236
- # '--jacocout', 'html',
1237
- # ])
1238
- # if mx.get_env("SONAR_HOST_URL", None):
1239
- # mx.run_mx(jacoco_args + [
1240
- # 'sonarqube-upload',
1241
- # '-Dsonar.host.url=%s' % mx.get_env("SONAR_HOST_URL"),
1242
- # '-Dsonar.projectKey=com.oracle.graalvm.python',
1243
- # '-Dsonar.projectName=GraalVM - Python',
1244
- # '--exclude-generated',
1245
- # ])
1246
- # mx.run_mx(jacoco_args + [
1247
- # 'coverage-upload',
1248
- # ])
1226
+ if args .jacoco :
1227
+ jacoco_args = [
1228
+ '--jacoco-whitelist-package' , 'com.oracle.graal.python' ,
1229
+ # '--jacoco-exclude-annotation', '@GeneratedBy',
1230
+ ]
1231
+ mx .run_mx (jacoco_args + [
1232
+ '--strict-compliance' ,
1233
+ '--dynamicimports' , '/compiler' ,
1234
+ '--primary' , 'gate' ,
1235
+ '-B=--force-deprecation-as-warning-for-dependencies' ,
1236
+ '--strict-mode' ,
1237
+ '--tags' , 'python-unittest,python-tagged-unittest,python-junit' ,
1238
+ '--jacocout' , 'html' ,
1239
+ ])
1240
+ if mx .get_env ("SONAR_HOST_URL" , None ):
1241
+ mx .run_mx (jacoco_args + [
1242
+ 'sonarqube-upload' ,
1243
+ '-Dsonar.host.url=%s' % mx .get_env ("SONAR_HOST_URL" ),
1244
+ '-Dsonar.projectKey=com.oracle.graalvm.python' ,
1245
+ '-Dsonar.projectName=GraalVM - Python' ,
1246
+ '--exclude-generated' ,
1247
+ ])
1248
+ mx .run_mx (jacoco_args + [
1249
+ 'coverage-upload' ,
1250
+ ])
1249
1251
if args .truffle :
1250
1252
executable = python_gvm ()
1251
1253
variants = [
@@ -1261,7 +1263,7 @@ def python_coverage(args):
1261
1263
outputlcov = "coverage.lcov"
1262
1264
if os .path .exists (outputlcov ):
1263
1265
os .unlink (outputlcov )
1264
- cmdargs = ["lcov" , "-o" , outputlcov ]
1266
+ cmdargs = ["/usr/bin/env" , " lcov" , "-o" , outputlcov ]
1265
1267
for kwds in variants :
1266
1268
variant_str = re .sub (r"[^a-zA-Z]" , "_" , repr (kwds ))
1267
1269
for pattern in ["py" ]:
@@ -1292,7 +1294,7 @@ def python_coverage(args):
1292
1294
datetime .datetime .fromtimestamp (info ['author-ts' ]).strftime ('%Y-%m-%d_%H_%M' ),
1293
1295
rev [:7 ],
1294
1296
)
1295
- mx .run (["genhtml" , "-o" , coverage_dir , outputlcov ])
1297
+ mx .run (["/usr/bin/env" , " genhtml" , "-o" , coverage_dir , outputlcov ])
1296
1298
if args .truffle_upload_url :
1297
1299
if not args .truffle_upload_url .endswith ("/" ):
1298
1300
args .truffle_upload_url = args .truffle_upload_url + "/"
0 commit comments