Skip to content

Commit 2d2566a

Browse files
committed
allow experimental options in all our Java tests
1 parent c00f325 commit 2d2566a

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/PythonTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static void enterContext(String... newArgs) {
9999
PythonTests.outArray.reset();
100100
PythonTests.errArray.reset();
101101
Context prevContext = context;
102-
context = Context.newBuilder().engine(engine).allowAllAccess(true).arguments("python", newArgs).option("python.Executable", executable).build();
102+
context = Context.newBuilder().engine(engine).allowExperimentalOptions(true).allowAllAccess(true).arguments("python", newArgs).option("python.Executable", executable).build();
103103
context.initialize("python");
104104
if (prevContext != null) {
105105
closeContext(prevContext);

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/advance/MultiContextTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ public void testSharingWithStruct() {
6969
}
7070

7171
private static Context newContext(Engine engine) {
72-
return Context.newBuilder().allowAllAccess(true).engine(engine).build();
72+
return Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).engine(engine).build();
7373
}
7474
}

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/debug/PythonDebugTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public class PythonDebugTest {
7878
@Before
7979
public void before() {
8080
Builder newBuilder = Context.newBuilder();
81+
newBuilder.allowExperimentalOptions(true);
8182
newBuilder.allowAllAccess(true);
8283
PythonTests.closeContext();
8384
tester = new DebuggerTester(newBuilder);

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop/InteropLibraryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class InteropLibraryTest extends PythonTests {
5959
@Before
6060
public void setUpTest() {
6161
Builder builder = Context.newBuilder();
62+
builder.allowExperimentalOptions(true);
6263
builder.allowAllAccess(true);
6364
context = builder.build();
6465
}

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop/JavaInteropTest.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@
5252
import java.util.Arrays;
5353
import java.util.List;
5454

55-
import com.oracle.graal.python.runtime.interop.InteropArray;
56-
import com.oracle.graal.python.test.PythonTests;
57-
import com.oracle.truffle.api.interop.ArityException;
58-
import com.oracle.truffle.api.interop.InteropLibrary;
59-
import com.oracle.truffle.api.interop.TruffleObject;
60-
import com.oracle.truffle.api.interop.UnknownIdentifierException;
61-
import com.oracle.truffle.api.library.ExportLibrary;
62-
import com.oracle.truffle.api.library.ExportMessage;
63-
6455
import org.graalvm.polyglot.Context;
6556
import org.graalvm.polyglot.Context.Builder;
6657
import org.graalvm.polyglot.Engine;
@@ -76,6 +67,15 @@
7667
import org.junit.runners.Parameterized.Parameter;
7768
import org.junit.runners.Parameterized.Parameters;
7869

70+
import com.oracle.graal.python.runtime.interop.InteropArray;
71+
import com.oracle.graal.python.test.PythonTests;
72+
import com.oracle.truffle.api.interop.ArityException;
73+
import com.oracle.truffle.api.interop.InteropLibrary;
74+
import com.oracle.truffle.api.interop.TruffleObject;
75+
import com.oracle.truffle.api.interop.UnknownIdentifierException;
76+
import com.oracle.truffle.api.library.ExportLibrary;
77+
import com.oracle.truffle.api.library.ExportMessage;
78+
7979
@RunWith(Enclosed.class)
8080
public class JavaInteropTest {
8181
public static class GeneralInterop extends PythonTests {
@@ -89,6 +89,7 @@ public void setUpTest() {
8989
out = new ByteArrayOutputStream();
9090
err = new ByteArrayOutputStream();
9191
Builder builder = Context.newBuilder();
92+
builder.allowExperimentalOptions(true);
9293
builder.allowAllAccess(true);
9394
builder.out(out);
9495
builder.err(err);
@@ -113,7 +114,7 @@ public void evalFailsOnError() {
113114

114115
@Test
115116
public void evalNonInteractiveThrowsSyntaxError() throws IOException {
116-
try (Context c = Context.newBuilder().allowAllAccess(true).option("python.TerminalIsInteractive", "false").build()) {
117+
try (Context c = Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).option("python.TerminalIsInteractive", "false").build()) {
117118
c.eval(Source.newBuilder("python", INCOMPLETE_SOURCE, "eval").interactive(false).build());
118119
} catch (PolyglotException t) {
119120
assertTrue(t.isSyntaxError());
@@ -125,7 +126,7 @@ public void evalNonInteractiveThrowsSyntaxError() throws IOException {
125126

126127
@Test
127128
public void evalNonInteractiveInInteractiveTerminalThrowsSyntaxError() throws IOException {
128-
try (Context c = Context.newBuilder().allowAllAccess(true).option("python.TerminalIsInteractive", "true").build()) {
129+
try (Context c = Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).option("python.TerminalIsInteractive", "true").build()) {
129130
c.eval(Source.newBuilder("python", INCOMPLETE_SOURCE, "eval").interactive(false).build());
130131
} catch (PolyglotException t) {
131132
assertTrue(t.isSyntaxError());
@@ -137,7 +138,7 @@ public void evalNonInteractiveInInteractiveTerminalThrowsSyntaxError() throws IO
137138

138139
@Test
139140
public void evalInteractiveInNonInteractiveTerminalThrowsSyntaxError() throws IOException {
140-
try (Context c = Context.newBuilder().allowAllAccess(true).option("python.TerminalIsInteractive", "false").build()) {
141+
try (Context c = Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).option("python.TerminalIsInteractive", "false").build()) {
141142
c.eval(Source.newBuilder("python", INCOMPLETE_SOURCE, "eval").interactive(true).build());
142143
} catch (PolyglotException t) {
143144
assertTrue(t.isSyntaxError());
@@ -149,7 +150,7 @@ public void evalInteractiveInNonInteractiveTerminalThrowsSyntaxError() throws IO
149150

150151
@Test
151152
public void evalInteractiveInInteractiveTerminalThrowsSyntaxError() throws IOException {
152-
try (Context c = Context.newBuilder().allowAllAccess(true).option("python.TerminalIsInteractive", "true").build()) {
153+
try (Context c = Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).option("python.TerminalIsInteractive", "true").build()) {
153154
c.eval(Source.newBuilder("python", INCOMPLETE_SOURCE, "eval").interactive(true).build());
154155
} catch (PolyglotException t) {
155156
assertTrue(t.isSyntaxError());
@@ -513,7 +514,7 @@ static class OptionsChecker {
513514
private Builder builder;
514515

515516
OptionsChecker(String option, String code, String... values) {
516-
this.builder = Context.newBuilder("python").engine(engine).allowAllAccess(true);
517+
this.builder = Context.newBuilder("python").engine(engine).allowExperimentalOptions(true).allowAllAccess(true);
517518
this.option = "python." + option;
518519
this.source = Source.create("python", code);
519520
this.values = values;

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/module/MemoryviewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ public void testContextReuse() {
5656
}
5757

5858
private static Context newContext(Engine engine) {
59-
return Context.newBuilder().allowAllAccess(true).engine(engine).build();
59+
return Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).engine(engine).build();
6060
}
6161
}

0 commit comments

Comments
 (0)