Skip to content

Commit e319441

Browse files
committed
Open packages for standalone points-to unit tests.
1 parent c588bdc commit e319441

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

substratevm/mx.substratevm/mx_substratevm.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,3 +2726,25 @@ def capnp_compile(args):
27262726
shaded = line.replace("org.capnproto", "com.oracle.svm.shaded.org.capnproto")
27272727
f.write(shaded)
27282728
f.write('}\n')
2729+
2730+
class StandalonePointstoUnittestsConfig(mx_unittest.MxUnittestConfig):
2731+
2732+
def __init__(self):
2733+
super(StandalonePointstoUnittestsConfig, self).__init__('standalone-pointsto-unittest')
2734+
2735+
def apply(self, config):
2736+
vmArgs, mainClass, mainClassArgs = config
2737+
2738+
vmArgs.extend(['--add-exports=jdk.graal.compiler/jdk.graal.compiler.options=ALL-UNNAMED'])
2739+
2740+
# JVMCI is dynamically exported to Graal when JVMCI is initialized. This is too late
2741+
# for the junit harness which uses reflection to find @Test methods. In addition, the
2742+
# tests widely use JVMCI classes so JVMCI needs to also export all its packages to
2743+
# ALL-UNNAMED.
2744+
mainClassArgs.extend(['-JUnitOpenPackages', 'jdk.internal.vm.ci/*=jdk.graal.compiler,ALL-UNNAMED'])
2745+
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.nativeimage/*=ALL-UNNAMED'])
2746+
2747+
return (vmArgs, mainClass, mainClassArgs)
2748+
2749+
2750+
mx_unittest.register_unittest_config(StandalonePointstoUnittestsConfig())

substratevm/mx.substratevm/suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,6 +2446,7 @@
24462446
"dependencies" : [
24472447
"com.oracle.graal.pointsto.standalone.test",
24482448
],
2449+
"unittestConfig" : "standalone-pointsto-unittest",
24492450
"distDependencies": [
24502451
"mx:JUNIT_TOOL",
24512452
"sdk:NATIVEIMAGE",

0 commit comments

Comments
 (0)