From 5cf426f6020f03a32858dc1913174650db635ac7 Mon Sep 17 00:00:00 2001 From: Martin Entlicher Date: Fri, 3 Nov 2023 16:50:00 +0100 Subject: [PATCH] Unignoring DAP tests. (GR-49885) --- .../com/oracle/truffle/tools/dap/test/DAPTester.java | 11 ++++++++++- .../com/oracle/truffle/tools/dap/test/ITLDAPTest.java | 6 ------ .../truffle/tools/dap/test/SimpleLanguageDAPTest.java | 4 +--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/DAPTester.java b/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/DAPTester.java index 18ba19a55397..2d628169dd05 100644 --- a/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/DAPTester.java +++ b/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/DAPTester.java @@ -98,14 +98,23 @@ Context getContext() { } public void finish() throws IOException { + finish(true); + } + + public void finish(boolean success) throws IOException { if (!lastValue.isDone()) { try { lastValue.get(); + if (!success) { + throw new AssertionError("Finished successfully, but expected to fail."); + } } catch (InterruptedException ex) { throw new AssertionError("Last eval(...) has not finished yet", ex); } catch (ExecutionException ex) { // Guest language execution failed - throw new AssertionError(ex); + if (success) { + throw new AssertionError(ex); + } } } if (handler.getInputStream().available() > 0) { diff --git a/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/ITLDAPTest.java b/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/ITLDAPTest.java index dc6a97d68309..46685e0c0f78 100644 --- a/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/ITLDAPTest.java +++ b/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/ITLDAPTest.java @@ -30,7 +30,6 @@ import org.graalvm.polyglot.Source; import org.junit.After; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import com.oracle.truffle.api.instrumentation.test.InstrumentationTestLanguage; @@ -48,7 +47,6 @@ public void tearDown() { } @Test - @Ignore("GR-43473") public void testOutput() throws Exception { Source source = Source.newBuilder(InstrumentationTestLanguage.ID, "ROOT(\n" + " PRINT(OUT, CONSTANT(\"one\ntwo\n\")),\n" + @@ -138,7 +136,6 @@ public void testOutput() throws Exception { } @Test - @Ignore("GR-43473") public void testOutputEarly() throws Exception { Source source1 = Source.newBuilder(InstrumentationTestLanguage.ID, "ROOT(\n" + " PRINT(OUT, CONSTANT(\"Prologue to stdout\n\")),\n" + @@ -187,7 +184,6 @@ public void testOutputEarly() throws Exception { @SuppressWarnings("deprecation") @Test - @Ignore("GR-43473") public void testMultiThreading() throws Exception { Source source = Source.newBuilder(InstrumentationTestLanguage.ID, new URL("file:///path/TestThreads.itl")).content("ROOT(\n" + "DEFINE(f,\n" + @@ -298,7 +294,6 @@ public void testMultiThreading() throws Exception { @SuppressWarnings("deprecation") @Test - @Ignore("GR-43473") public void testBadSourceReference() throws Exception { Source source = Source.newBuilder(InstrumentationTestLanguage.ID, new URL("file:///path/TestSrcRef.itl")).content("ROOT(\n" + " STATEMENT(),\n" + @@ -348,7 +343,6 @@ public void testBadSourceReference() throws Exception { } @Test - @Ignore("GR-43473") public void testEagerSourceLoad() throws Exception { Source source1 = Source.newBuilder(InstrumentationTestLanguage.ID, "ROOT(\n" + " EXPRESSION(),\n" + diff --git a/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/SimpleLanguageDAPTest.java b/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/SimpleLanguageDAPTest.java index 5efa853bf190..546d61c1e769 100644 --- a/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/SimpleLanguageDAPTest.java +++ b/tools/src/com.oracle.truffle.tools.dap.test/src/com/oracle/truffle/tools/dap/test/SimpleLanguageDAPTest.java @@ -33,12 +33,10 @@ import org.graalvm.polyglot.Source; import org.junit.After; -import org.junit.Ignore; import org.junit.Test; import static com.oracle.truffle.tools.dap.test.DAPTester.getFilePath; -@Ignore("GR-43473") public final class SimpleLanguageDAPTest { private static final String FACTORIAL = "function factorial(n) {\n" + @@ -1022,7 +1020,7 @@ public void testExceptionBreakpoints() throws Exception { "{\"event\":\"continued\",\"body\":{\"threadId\":1,\"allThreadsContinued\":false},\"type\":\"event\"}", "{\"success\":true,\"body\":{\"allThreadsContinued\":false},\"type\":\"response\",\"request_seq\":9,\"command\":\"continue\"}" ); - tester.finish(); + tester.finish(false); } @Test