Skip to content

Commit b59996c

Browse files
committed
Refactor setting the EvalReturnsInstance option in tests
1 parent bc1940a commit b59996c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/WasmFileSuite.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ private WasmTestStatus runTestCase(WasmCase testCase, Engine sharedEngine) {
341341

342342
contextBuilder.option("wasm.Builtins", includedExternalModules());
343343
contextBuilder.option("wasm.WasiConstantRandomGet", "true");
344+
contextBuilder.option("wasm.EvalReturnsInstance", "true");
344345
final String commandLineArgs = testCase.options().getProperty("command-line-args");
345346
if (commandLineArgs != null) {
346347
// The first argument is the program name. We set it to the empty string in tests.
@@ -415,7 +416,7 @@ private void runInContexts(WasmCase testCase, Context.Builder contextBuilder, Ar
415416
interpreterIterations = Math.min(interpreterIterations, 1);
416417
}
417418

418-
context = contextBuilder.options(getInterpreted()).option("wasm.EvalReturnsInstance", "true").build();
419+
context = contextBuilder.options(getInterpreted()).build();
419420
runInContext(testCase, context, sources, interpreterIterations, PHASE_INTERPRETER_ICON, "interpreter", testOut);
420421

421422
if (isFallbackRuntime()) {
@@ -429,7 +430,7 @@ private void runInContexts(WasmCase testCase, Context.Builder contextBuilder, Ar
429430
if (WasmTestOptions.COVERAGE_MODE) {
430431
syncNoinlineIterations = Math.min(syncNoinlineIterations, 1);
431432
}
432-
context = contextBuilder.options(getSyncCompiledNoInline()).option("wasm.EvalReturnsInstance", "true").build();
433+
context = contextBuilder.options(getSyncCompiledNoInline()).build();
433434
runInContext(testCase, context, sources, syncNoinlineIterations, PHASE_SYNC_NO_INLINE_ICON, "sync,no-inl", testOut);
434435

435436
// Run in synchronous compiled mode, with inlining turned on.
@@ -439,15 +440,15 @@ private void runInContexts(WasmCase testCase, Context.Builder contextBuilder, Ar
439440
if (WasmTestOptions.COVERAGE_MODE) {
440441
syncInlineIterations = Math.min(syncInlineIterations, 1);
441442
}
442-
context = contextBuilder.options(getSyncCompiledWithInline()).option("wasm.EvalReturnsInstance", "true").build();
443+
context = contextBuilder.options(getSyncCompiledWithInline()).build();
443444
runInContext(testCase, context, sources, syncInlineIterations, PHASE_SYNC_INLINE_ICON, "sync,inl", testOut);
444445

445446
// Run with normal, asynchronous compilation.
446447
int asyncIterations = Integer.parseInt(testCase.options().getProperty("async-iterations", String.valueOf(DEFAULT_ASYNC_ITERATIONS)));
447448
if (WasmTestOptions.COVERAGE_MODE) {
448449
asyncIterations = Math.min(asyncIterations, 1);
449450
}
450-
context = contextBuilder.options(getAsyncCompiled()).option("wasm.EvalReturnsInstance", "true").build();
451+
context = contextBuilder.options(getAsyncCompiled()).build();
451452
runInContext(testCase, context, sources, asyncIterations, PHASE_ASYNC_ICON, "async,multi", testOut);
452453
} else {
453454
int asyncSharedIterations = testCase.options().containsKey("async-iterations") && !testCase.options().containsKey("async-shared-iterations")
@@ -456,7 +457,7 @@ private void runInContexts(WasmCase testCase, Context.Builder contextBuilder, Ar
456457
if (WasmTestOptions.COVERAGE_MODE) {
457458
asyncSharedIterations = Math.min(asyncSharedIterations, 1);
458459
}
459-
context = contextBuilder.option("wasm.EvalReturnsInstance", "true").build();
460+
context = contextBuilder.build();
460461
runInContext(testCase, context, sources, asyncSharedIterations, PHASE_SHARED_ENGINE_ICON, "async,shared", testOut);
461462
}
462463
}

0 commit comments

Comments
 (0)