Skip to content

Commit f6bf07e

Browse files
committed
Run wasm unit tests using built GraalVM if compiler suite is imported.
1 parent 0d0d1b2 commit f6bf07e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

wasm/mx.wasm/mx_wasm.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
def get_jdk(forBuild=False):
8686
if not forBuild and mx.suite('compiler', fatalIfMissing=False):
87-
return mx.get_jdk(tag='jvmci')
87+
return mx.get_jdk(tag='graalvm')
8888
else:
8989
return mx.get_jdk()
9090

@@ -125,24 +125,28 @@ def wabt_test_args():
125125

126126

127127
def graal_wasm_gate_runner(args, tasks):
128+
unittest_args = []
129+
if mx.suite('compiler', fatalIfMissing=False) is not None:
130+
unittest_args = ["--use-graalvm"]
131+
128132
with Task("BuildAll", tasks, tags=[GraalWasmDefaultTags.buildall]) as t:
129133
if t:
130134
mx.build(["--all"])
131135

132136
with Task("UnitTests", tasks, tags=[GraalWasmDefaultTags.wasmtest], report=True) as t:
133137
if t:
134-
unittest([*wabt_test_args(), "WasmTestSuite"], test_report_tags={'task': t.title})
135-
unittest([*wabt_test_args(), "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
138+
unittest(unittest_args + [*wabt_test_args(), "WasmTestSuite"], test_report_tags={'task': t.title})
139+
unittest(unittest_args + [*wabt_test_args(), "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
136140

137141
with Task("ExtraUnitTests", tasks, tags=[GraalWasmDefaultTags.wasmextratest], report=True) as t:
138142
if t:
139-
unittest(["--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
143+
unittest(unittest_args + ["--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
140144

141145
with Task("CoverageTests", tasks, tags=[GraalWasmDefaultTags.coverage], report=True) as t:
142146
if t:
143-
unittest([*wabt_test_args(), "-Dwasmtest.coverageMode=true", "WasmTestSuite"], test_report_tags={'task': t.title})
144-
unittest([*wabt_test_args(), "-Dwasmtest.coverageMode=true", "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
145-
unittest(["-Dwasmtest.coverageMode=true", "--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
147+
unittest(unittest_args + [*wabt_test_args(), "-Dwasmtest.coverageMode=true", "WasmTestSuite"], test_report_tags={'task': t.title})
148+
unittest(unittest_args + [*wabt_test_args(), "-Dwasmtest.coverageMode=true", "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
149+
unittest(unittest_args + ["-Dwasmtest.coverageMode=true", "--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
146150

147151
# This is a gate used to test that all the benchmarks return the correct results. It does not upload anything,
148152
# and does not run on a dedicated machine.

0 commit comments

Comments
 (0)