Skip to content

Commit 127ab54

Browse files
committed
Skip instrumentation tests on bytecode interpreter
1 parent 9619be2 commit 127ab54

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,16 @@
4848
import java.util.Collections;
4949
import java.util.Map;
5050

51-
import com.oracle.truffle.api.strings.TruffleString;
5251
import org.graalvm.polyglot.Context;
5352
import org.graalvm.polyglot.Engine;
5453
import org.graalvm.polyglot.PolyglotException;
5554
import org.graalvm.polyglot.Value;
5655
import org.junit.Assert;
56+
import org.junit.Assume;
5757

5858
import com.oracle.graal.python.PythonLanguage;
5959
import com.oracle.graal.python.runtime.PythonContext;
60+
import com.oracle.graal.python.runtime.PythonOptions;
6061
import com.oracle.graal.python.runtime.PythonParser.ParserMode;
6162
import com.oracle.graal.python.runtime.exception.PException;
6263
import com.oracle.graal.python.test.interop.JavaInteropTest;
@@ -68,6 +69,7 @@
6869
import com.oracle.truffle.api.nodes.RootNode;
6970
import com.oracle.truffle.api.source.Source;
7071
import com.oracle.truffle.api.source.Source.LiteralBuilder;
72+
import com.oracle.truffle.api.strings.TruffleString;
7173

7274
public class PythonTests {
7375
static {
@@ -132,6 +134,10 @@ public static void closeContext() {
132134
}
133135
}
134136

137+
public static void skipOnBytecodeInterpreter() {
138+
Assume.assumeFalse(PythonOptions.EnableBytecodeInterpreter.getDefaultValue());
139+
}
140+
135141
public static void assertBenchNoError(Path scriptName, String[] args) {
136142
final ByteArrayOutputStream byteArrayErr = new ByteArrayOutputStream();
137143
final ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();

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
@@ -83,6 +83,7 @@ public void before() {
8383
newBuilder.allowAllAccess(true);
8484
PythonTests.closeContext();
8585
tester = new DebuggerTester(newBuilder);
86+
PythonTests.skipOnBytecodeInterpreter();
8687
}
8788

8889
@After

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.graalvm.polyglot.Engine;
5151
import org.graalvm.polyglot.Instrument;
5252
import org.graalvm.polyglot.Source;
53+
import org.junit.Before;
5354
import org.junit.Test;
5455

5556
import com.oracle.graal.python.nodes.PNode;
@@ -77,6 +78,11 @@ private static Context newContext(Engine engine) {
7778
return Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).engine(engine).build();
7879
}
7980

81+
@Before
82+
public void before() {
83+
PythonTests.skipOnBytecodeInterpreter();
84+
}
85+
8086
@Test
8187
public void testInModule() throws Exception {
8288
String code = "a = 0\n" +

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545

4646
import java.util.HashMap;
4747

48+
import org.graalvm.polyglot.Context;
49+
import org.graalvm.polyglot.Engine;
50+
import org.graalvm.polyglot.Instrument;
51+
import org.graalvm.polyglot.Source;
52+
import org.junit.Assert;
53+
import org.junit.Before;
54+
import org.junit.Test;
55+
4856
import com.oracle.graal.python.nodes.PNode;
4957
import com.oracle.graal.python.nodes.function.InnerRootNode;
5058
import com.oracle.graal.python.test.PythonTests;
@@ -59,13 +67,6 @@
5967
import com.oracle.truffle.api.library.LibraryFactory;
6068
import com.oracle.truffle.api.nodes.Node;
6169

62-
import org.graalvm.polyglot.Context;
63-
import org.graalvm.polyglot.Engine;
64-
import org.graalvm.polyglot.Instrument;
65-
import org.graalvm.polyglot.Source;
66-
import org.junit.Assert;
67-
import org.junit.Test;
68-
6970
@SuppressWarnings("all")
7071
public class StandardTagsTests extends PythonTests {
7172

@@ -75,6 +76,11 @@ private static Context newContext(Engine engine) {
7576
return Context.newBuilder().allowExperimentalOptions(true).allowAllAccess(true).engine(engine).build();
7677
}
7778

79+
@Before
80+
public void before() {
81+
PythonTests.skipOnBytecodeInterpreter();
82+
}
83+
7884
@Test
7985
public void testRootBodyTagModule() throws Exception {
8086
String code = "import time\n" +

0 commit comments

Comments
 (0)