Skip to content

Commit 5c00c71

Browse files
committed
Remove host interop test for tag 'python-svm-unittest'.
1 parent 55e93bd commit 5c00c71

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class GraalPythonTags(object):
255255
junit = 'python-junit'
256256
unittest = 'python-unittest'
257257
cpyext = 'python-cpyext'
258-
svmunit = 'python-svm-unitttest'
258+
svmunit = 'python-svm-unittest'
259259
benchmarks = 'python-benchmarks'
260260
downstream = 'python-downstream'
261261
graalvm = 'python-graalvm'
@@ -363,8 +363,34 @@ def graalpython_gate_runner(args, tasks):
363363
python_svm(["-h"])
364364
if os.path.exists("./graalpython-svm"):
365365
langhome = mx_subst.path_substitutions.substitute('--native.Dllvm.home=<path:SULONG_LIBS>')
366-
test_args = ["graalpython/com.oracle.graal.python.test/src/graalpytest.py", "-v",
367-
"graalpython/com.oracle.graal.python.test/src/tests/"]
366+
367+
# tests root directory
368+
tests_folder = "graalpython/com.oracle.graal.python.test/src/tests/"
369+
370+
# list of excluded tests
371+
excluded = ["test_interop.py"]
372+
373+
def is_included(path):
374+
if path.endswith(".py"):
375+
basename = path.rpartition("/")[2]
376+
return basename.startswith("test_") and basename not in excluded
377+
return False
378+
379+
# list all 1st-level tests and exclude the SVM-incompatible ones
380+
testfiles = []
381+
paths = [tests_folder]
382+
while paths:
383+
path = paths.pop()
384+
if is_included(path):
385+
testfiles.append(path)
386+
else:
387+
try:
388+
paths += [(path + f if path.endswith("/") else "%s/%s" % (path, f)) for f in
389+
os.listdir(path)]
390+
except OSError:
391+
pass
392+
393+
test_args = ["graalpython/com.oracle.graal.python.test/src/graalpytest.py", "-v"] + testfiles
368394
mx.run(["./graalpython-svm", "--python.CoreHome=graalpython/lib-graalpython", "--python.StdLibHome=graalpython/lib-python/3", langhome] + test_args, nonZeroIsFatal=True)
369395

370396
with Task('GraalPython downstream R tests', tasks, tags=[GraalPythonTags.downstream, GraalPythonTags.R]) as task:

0 commit comments

Comments
 (0)