4040 */
4141package com .oracle .graal .python .test .debug ;
4242
43+ import static com .oracle .graal .python .test .integration .PythonTests .eval ;
4344import static org .junit .Assert .assertEquals ;
4445import static org .junit .Assert .assertFalse ;
4546import static org .junit .Assert .assertNotNull ;
5859import org .graalvm .polyglot .Context ;
5960import org .graalvm .polyglot .Context .Builder ;
6061import org .graalvm .polyglot .Source ;
62+ import org .graalvm .polyglot .Value ;
6163import org .junit .After ;
6264import org .junit .Assume ;
6365import org .junit .Before ;
@@ -93,7 +95,9 @@ public void dispose() {
9395
9496 @ Test
9597 public void testSteppingAsExpected () throws Throwable {
96- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
98+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
99+ // GR-71618
100+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
97101 // test that various elements step as expected, including generators, statement level atomic
98102 // expressions, and roots
99103 final Source source = Source .newBuilder ("python" , "" +
@@ -186,7 +190,9 @@ public void testSteppingAsExpected() throws Throwable {
186190
187191 @ Test
188192 public void testException () throws Throwable {
189- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
193+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
194+ // GR-71618
195+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
190196 final Source source = Source .newBuilder ("python" , "" +
191197 "try:\n " +
192198 " 1 / 0\n " +
@@ -210,7 +216,9 @@ public void testException() throws Throwable {
210216
211217 @ Test
212218 public void testInlineEvaluation () throws Throwable {
213- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
219+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
220+ // GR-71618
221+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
214222 final Source source = Source .newBuilder ("python" , "" +
215223 "y = 4\n " +
216224 "def foo(x):\n " +
@@ -245,7 +253,9 @@ public void testInlineEvaluation() throws Throwable {
245253 @ Test
246254 @ SuppressWarnings ("try" )
247255 public void testBreakpointBuiltin () throws Throwable {
248- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
256+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
257+ // GR-71618
258+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
249259 final Source source = Source .newBuilder ("python" , "" +
250260 "def foo():\n " +
251261 " a = 1\n " +
@@ -267,7 +277,9 @@ public void testBreakpointBuiltin() throws Throwable {
267277
268278 @ Test
269279 public void testConditionalBreakpointInFunction () throws Throwable {
270- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
280+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
281+ // GR-71618
282+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
271283 final Source source = Source .newBuilder ("python" , "" +
272284 "def fun():\n " +
273285 " def prod(n):\n " +
@@ -313,7 +325,9 @@ public void testConditionalBreakpointInFunction() throws Throwable {
313325
314326 @ Test
315327 public void testConditionalBreakpointGlobal () throws Throwable {
316- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
328+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
329+ // GR-71618
330+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
317331 final Source source = Source .newBuilder ("python" , "" +
318332 "values = []\n " +
319333 "for i in range(0, 10):\n " +
@@ -337,7 +351,9 @@ public void testConditionalBreakpointGlobal() throws Throwable {
337351
338352 @ Test
339353 public void testReenterArgumentsAndValues () throws Throwable {
340- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
354+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
355+ // GR-71618
356+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
341357 // Test that after a re-enter, arguments are kept and variables are cleared.
342358 final Source source = Source .newBuilder ("python" , "" +
343359 "def main():\n " +
@@ -392,7 +408,9 @@ public void testReenterArgumentsAndValues() throws Throwable {
392408 @ Test
393409 @ SuppressWarnings ("deprecation" )
394410 public void testGettersSetters () throws Throwable {
395- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
411+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
412+ // GR-71618
413+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
396414 final Source source = Source .newBuilder ("python" , "" +
397415 "class GetterOnly:\n " +
398416 " def __get__(self):\n " +
@@ -462,7 +480,9 @@ public void testGettersSetters() throws Throwable {
462480
463481 @ Test
464482 public void testInspectJavaArray () throws Throwable {
465- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
483+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
484+ // GR-71618
485+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
466486 final Source source = Source .newBuilder ("python" , "" +
467487 "import java\n " +
468488 "a_int = java.type('int[]')(3)\n " +
@@ -508,7 +528,9 @@ public void testInspectJavaArray() throws Throwable {
508528
509529 @ Test
510530 public void testSourceFileURI () throws Throwable {
511- Assume .assumeFalse ("TODO: debugger tests are broken on Bytecode DSL" , Boolean .getBoolean ("python.EnableBytecodeDSLInterpreter" ));
531+ Value isBytecodeDLS = eval ("__graalpython__.is_bytecode_dsl_interpreter" );
532+ // GR-71618
533+ Assume .assumeFalse ("TODO: wrong stacktrace" , isBytecodeDLS .asBoolean ());
512534 if (System .getProperty ("os.name" ).toLowerCase ().contains ("mac" )) {
513535 // on the mac machines we run with symlinked directories and such and it's annoying to
514536 // cater for that
0 commit comments