From 0a99cb802d5784a374e29eb2e7f6acb66b298c13 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Mon, 22 May 2023 11:28:09 +0300 Subject: [PATCH] Update flags for DebugSymbolsSmoke test for GraalVM 23.0 as well New behaviour backported to 23.0 as well https://github.com/oracle/graal/commit/eefeda1b94dd1a24aa6d1a557448a4e90d51c591 Relates to #154 --- .../tests/integration/AppReproducersTest.java | 19 ++++++-------- .../tests/integration/DebugSymbolsTest.java | 25 ++++++++----------- .../integration/utils/BuildAndRunCmds.java | 4 +-- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/AppReproducersTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/AppReproducersTest.java index 1f0eaf63..f27f9db1 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/AppReproducersTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/AppReproducersTest.java @@ -56,8 +56,8 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.TrackNodeSourcePosition_23_0; -import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.DebugCodeInfoUseSourceMappings_23_1; -import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.OmitInlinedMethodDebugLineInfo_23_1; +import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.DebugCodeInfoUseSourceMappings_23_0; +import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.OmitInlinedMethodDebugLineInfo_23_0; import static org.graalvm.tests.integration.utils.Commands.builderRoutine; import static org.graalvm.tests.integration.utils.Commands.cleanTarget; import static org.graalvm.tests.integration.utils.Commands.cleanup; @@ -846,21 +846,16 @@ public void nativeJVMTextProcessing(TestInfo testInfo) throws IOException, Inter Map switches; Version version = UsedVersion.getVersion(app.runtimeContainer != ContainerNames.NONE); - if (version.compareTo(Version.create(23, 1, 0)) >= 0) { + if (version.compareTo(Version.create(23, 0, 0)) >= 0) { switches = Map.of( TrackNodeSourcePosition_23_0.token, TrackNodeSourcePosition_23_0.replacement, - DebugCodeInfoUseSourceMappings_23_1.token, DebugCodeInfoUseSourceMappings_23_1.replacement, - OmitInlinedMethodDebugLineInfo_23_1.token, OmitInlinedMethodDebugLineInfo_23_1.replacement); - } else if (version.compareTo(Version.create(23, 0, 0)) >= 0) { - switches = Map.of( - TrackNodeSourcePosition_23_0.token, TrackNodeSourcePosition_23_0.replacement, - DebugCodeInfoUseSourceMappings_23_1.token, "", - OmitInlinedMethodDebugLineInfo_23_1.token, ""); + DebugCodeInfoUseSourceMappings_23_0.token, DebugCodeInfoUseSourceMappings_23_0.replacement, + OmitInlinedMethodDebugLineInfo_23_0.token, OmitInlinedMethodDebugLineInfo_23_0.replacement); } else { switches = Map.of( TrackNodeSourcePosition_23_0.token, "", - DebugCodeInfoUseSourceMappings_23_1.token, "", - OmitInlinedMethodDebugLineInfo_23_1.token, ""); + DebugCodeInfoUseSourceMappings_23_0.token, "", + OmitInlinedMethodDebugLineInfo_23_0.token, ""); } // In this case, the two last commands are used for running the app; one in JVM mode and the other in Native mode. // We should somehow capture this semantically in an Enum or something. This is fragile... diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java index 296d55ff..19238941 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java @@ -52,8 +52,8 @@ import java.util.stream.Stream; import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.TrackNodeSourcePosition_23_0; -import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.DebugCodeInfoUseSourceMappings_23_1; -import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.OmitInlinedMethodDebugLineInfo_23_1; +import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.DebugCodeInfoUseSourceMappings_23_0; +import static org.graalvm.tests.integration.DebugSymbolsTest.DebugOptions.OmitInlinedMethodDebugLineInfo_23_0; import static org.graalvm.tests.integration.utils.Commands.CONTAINER_RUNTIME; import static org.graalvm.tests.integration.utils.Commands.QUARKUS_VERSION; import static org.graalvm.tests.integration.utils.Commands.builderRoutine; @@ -86,9 +86,9 @@ public class DebugSymbolsTest { public static final String BASE_DIR = getBaseDir(); public enum DebugOptions { - TrackNodeSourcePosition_23_0("", "-H:+TrackNodeSourcePosition"), - DebugCodeInfoUseSourceMappings_23_1("", "-H:+DebugCodeInfoUseSourceMappings"), - OmitInlinedMethodDebugLineInfo_23_1("", "-H:+OmitInlinedMethodDebugLineInfo"); + TrackNodeSourcePosition_23_0("", "-H:+TrackNodeSourcePosition"), + DebugCodeInfoUseSourceMappings_23_0("", "-H:+DebugCodeInfoUseSourceMappings"), + OmitInlinedMethodDebugLineInfo_23_0("", "-H:+OmitInlinedMethodDebugLineInfo"); public final String token; final String replacement; @@ -120,21 +120,16 @@ public void debugSymbolsSmokeGDB(TestInfo testInfo) throws IOException, Interrup Map switches; Version version = UsedVersion.getVersion(app.runtimeContainer != ContainerNames.NONE); - if (version.compareTo(Version.create(23, 1, 0)) >= 0) { + if (version.compareTo(Version.create(23, 0, 0)) >= 0) { switches = Map.of( TrackNodeSourcePosition_23_0.token, TrackNodeSourcePosition_23_0.replacement, - DebugCodeInfoUseSourceMappings_23_1.token, DebugCodeInfoUseSourceMappings_23_1.replacement, - OmitInlinedMethodDebugLineInfo_23_1.token, OmitInlinedMethodDebugLineInfo_23_1.replacement); - } else if (version.compareTo(Version.create(23, 0, 0)) >= 0) { - switches = Map.of( - TrackNodeSourcePosition_23_0.token, TrackNodeSourcePosition_23_0.replacement, - DebugCodeInfoUseSourceMappings_23_1.token, "", - OmitInlinedMethodDebugLineInfo_23_1.token, ""); + DebugCodeInfoUseSourceMappings_23_0.token, DebugCodeInfoUseSourceMappings_23_0.replacement, + OmitInlinedMethodDebugLineInfo_23_0.token, OmitInlinedMethodDebugLineInfo_23_0.replacement); } else { switches = Map.of( TrackNodeSourcePosition_23_0.token, "", - DebugCodeInfoUseSourceMappings_23_1.token, "", - OmitInlinedMethodDebugLineInfo_23_1.token, ""); + DebugCodeInfoUseSourceMappings_23_0.token, "", + OmitInlinedMethodDebugLineInfo_23_0.token, ""); } // In this case, the two last commands are used for running the app; one in JVM mode and the other in Native mode. // We should somehow capture this semantically in an Enum or something. This is fragile... diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/BuildAndRunCmds.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/BuildAndRunCmds.java index 66ab82d9..3ef3860d 100755 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/BuildAndRunCmds.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/BuildAndRunCmds.java @@ -208,8 +208,8 @@ public enum BuildAndRunCmds { new String[]{"native-image", "-H:GenerateDebugInfo=1", "-H:+PreserveFramePointer", "-H:-DeleteLocalSymbols", DebugSymbolsTest.DebugOptions.TrackNodeSourcePosition_23_0.token, - DebugSymbolsTest.DebugOptions.DebugCodeInfoUseSourceMappings_23_1.token, - DebugSymbolsTest.DebugOptions.OmitInlinedMethodDebugLineInfo_23_1.token, + DebugSymbolsTest.DebugOptions.DebugCodeInfoUseSourceMappings_23_0.token, + DebugSymbolsTest.DebugOptions.OmitInlinedMethodDebugLineInfo_23_0.token, "-jar", "target/debug-symbols-smoke.jar", "target/debug-symbols-smoke"}, new String[]{"java", "-jar", "./target/debug-symbols-smoke.jar"}, new String[]{IS_THIS_WINDOWS ? "target\\debug-symbols-smoke.exe" : "./target/debug-symbols-smoke"}