@@ -265,6 +265,7 @@ def python3_unittests(args):
265
265
# mx gate --tags pythontest
266
266
# mx gate --tags fulltest
267
267
268
+ AOT_INCOMPATIBLE_TESTS = ["test_interop.py" ]
268
269
269
270
class GraalPythonTags (object ):
270
271
junit = 'python-junit'
@@ -348,20 +349,18 @@ def gate_unittests(args=[], subdir=""):
348
349
mx .run (["python3" ] + test_args , nonZeroIsFatal = True )
349
350
350
351
351
- def _python_svm_unittest (svm_image ):
352
- suite_dir = _suite .dir
353
- llvm_home = mx_subst .path_substitutions .substitute ('--native.Dllvm.home=<path:SULONG_LIBS>' )
354
-
352
+ def run_python_unittests (python_binary , args = [], aot_compatible = True , exclude = []):
355
353
# tests root directory
356
- tests_folder = os .path .join (suite_dir , "graalpython" , "com.oracle.graal.python.test" , "src" , "tests" )
354
+ tests_folder = os .path .join (_suite . dir , "graalpython" , "com.oracle.graal.python.test" , "src" , "tests" )
357
355
358
356
# list of excluded tests
359
- excluded = ["test_interop.py" ]
357
+ if aot_compatible :
358
+ exclude += AOT_INCOMPATIBLE_TESTS
360
359
361
360
def is_included (path ):
362
361
if path .endswith (".py" ):
363
362
basename = os .path .basename (path )
364
- return basename .startswith ("test_" ) and basename not in excluded
363
+ return basename .startswith ("test_" ) and basename not in exclude
365
364
return False
366
365
367
366
# list all 1st-level tests and exclude the SVM-incompatible ones
@@ -378,13 +377,9 @@ def is_included(path):
378
377
except OSError :
379
378
pass
380
379
381
- args = ["--python.CoreHome=%s" % os .path .join (suite_dir , "graalpython" , "lib-graalpython" ),
382
- "--python.StdLibHome=%s" % os .path .join (suite_dir , "graalpython" , "lib-python/3" ),
383
- llvm_home ,
384
- os .path .join (suite_dir , "graalpython" , "com.oracle.graal.python.test" , "src" , "graalpytest.py" ),
385
- "-v" ]
380
+ args += [os .path .join (_suite .dir , "graalpython" , "com.oracle.graal.python.test" , "src" , "graalpytest.py" ), "-v" ]
386
381
args += testfiles
387
- return mx .run ([svm_image ] + args , nonZeroIsFatal = True )
382
+ return mx .run ([python_binary ] + args , nonZeroIsFatal = True )
388
383
389
384
390
385
def graalpython_gate_runner (args , tasks ):
@@ -414,7 +409,11 @@ def graalpython_gate_runner(args, tasks):
414
409
if not os .path .exists (svm_image_name ):
415
410
python_svm (["-h" ])
416
411
else :
417
- _python_svm_unittest (svm_image_name )
412
+ llvm_home = mx_subst .path_substitutions .substitute ('--native.Dllvm.home=<path:SULONG_LIBS>' )
413
+ args = ["--python.CoreHome=%s" % os .path .join (_suite .dir , "graalpython" , "lib-graalpython" ),
414
+ "--python.StdLibHome=%s" % os .path .join (_suite .dir , "graalpython" , "lib-python/3" ),
415
+ llvm_home ]
416
+ run_python_unittests (svm_image_name , args )
418
417
419
418
with Task ('GraalPython apptests' , tasks , tags = [GraalPythonTags .apptests ]) as task :
420
419
if task :
0 commit comments