Skip to content

Commit be5e1bc

Browse files
committed
Make Java tests use JAVA_HOME executables
1 parent 0fa08c8 commit be5e1bc

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

testsuite/python_support/utils.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,17 @@ def fmt_str_list(strings: List[str]) -> str:
481481
valgrind_suppressions=['ocaml'])
482482

483483
if java_main is not None:
484+
java_exec = P.realpath(P.join(
485+
env['JAVA_HOME'],
486+
'bin',
487+
'java'
488+
))
484489
cmd = [
485-
'java',
490+
java_exec,
486491
'-Dfile.encoding=UTF-8',
487492
f"-Djava.library.path={env['LD_LIBRARY_PATH']}",
488493
]
489-
if 'graalvm' in env.get("JAVA_HOME", ''):
494+
if 'graalvm' in env['JAVA_HOME']:
490495
cmd.append((
491496
'--add-opens=org.graalvm.truffle/com.oracle.truffle.api.'
492497
'strings=ALL-UNNAMED'
@@ -498,21 +503,26 @@ def fmt_str_list(strings: List[str]) -> str:
498503

499504
if ni_main is not None:
500505
# Compile the Java tests
506+
javac_exec = P.realpath(P.join(
507+
env['JAVA_HOME'],
508+
'bin',
509+
'javac'
510+
))
501511
run(
502-
'javac',
512+
javac_exec,
503513
'-encoding', 'utf8',
504514
f'{ni_main}.java',
505515
)
506516

507517
# Run native-image to compile the tests
508518
ni_exec = P.realpath(P.join(
509-
os.environ["GRAAL_HOME"],
519+
os.environ['GRAAL_HOME'],
510520
'bin',
511521
'native-image'
512522
))
513523
class_path = os.path.pathsep.join([
514524
P.realpath('.'),
515-
env.get('CLASSPATH', ''),
525+
env['CLASSPATH'],
516526
])
517527
run(
518528
ni_exec,

0 commit comments

Comments
 (0)