Skip to content

Commit 4d80b34

Browse files
committed
mx_graalpython.py: add EE gvm launcher, add cwd arg to running tagged tests
1 parent 8d7ec06 commit 4d80b34

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,11 @@ def python_managed_gvm(_=None):
563563
mx.log(launcher)
564564
return launcher
565565

566+
def python_enterprise_gvm(_=None):
567+
home = _graalvm_home(envfile="graalpython-managed-bash-launcher")
568+
launcher = _join_bin(home, "graalpython")
569+
mx.log(launcher)
570+
return launcher
566571

567572
def python_gvm_with_assertions():
568573
launcher = python_gvm()
@@ -668,7 +673,7 @@ def is_included(path):
668673
return testfiles
669674

670675

671-
def run_python_unittests(python_binary, args=None, paths=None, aot_compatible=False, exclude=None, env=None, use_pytest=False):
676+
def run_python_unittests(python_binary, args=None, paths=None, aot_compatible=False, exclude=None, env=None, use_pytest=False, cwd=None):
672677
# ensure that the test distribution is up-to-date
673678
mx.command_function("build")(["--dep", "com.oracle.graal.python.test"])
674679

@@ -714,7 +719,7 @@ def run_python_unittests(python_binary, args=None, paths=None, aot_compatible=Fa
714719
# jacoco only dumps the data on exit, and when we run all our unittests
715720
# at once it generates so much data we run out of heap space
716721
for testfile in testfiles:
717-
mx.run([launcher_path] + args + [testfile], nonZeroIsFatal=False, env=env)
722+
mx.run([launcher_path] + args + [testfile], nonZeroIsFatal=False, env=env, cwd=cwd)
718723
finally:
719724
shutil.move(launcher_path_bak, launcher_path)
720725
else:
@@ -727,11 +732,11 @@ def graalvm_vm_arg(java_arg):
727732
# jacoco only dumps the data on exit, and when we run all our unittests
728733
# at once it generates so much data we run out of heap space
729734
for testfile in testfiles:
730-
mx.run([python_binary, "--jvm", agent_args] + args + [testfile], nonZeroIsFatal=False, env=env)
735+
mx.run([python_binary, "--jvm", agent_args] + args + [testfile], nonZeroIsFatal=False, env=env, cwd=cwd)
731736
else:
732737
args += testfiles
733738
mx.logv(" ".join([python_binary] + args))
734-
return mx.run([python_binary] + args, nonZeroIsFatal=True, env=env)
739+
return mx.run([python_binary] + args, nonZeroIsFatal=True, env=env, cwd=cwd)
735740

736741

737742
def is_bash_launcher(launcher_path):
@@ -764,7 +769,7 @@ def run_hpy_unittests(python_binary, args=None):
764769
return run_python_unittests(python_binary, args=args, paths=[_hpy_test_root()], env=env, use_pytest=True)
765770

766771

767-
def run_tagged_unittests(python_binary, env=None):
772+
def run_tagged_unittests(python_binary, env=None, cwd=None):
768773
if env is None:
769774
env = os.environ
770775
sub_env = dict(
@@ -778,6 +783,7 @@ def run_tagged_unittests(python_binary, env=None):
778783
args=["-v"],
779784
paths=["test_tagged_unittests.py"],
780785
env=sub_env,
786+
cwd=cwd
781787
)
782788

783789

0 commit comments

Comments
 (0)