Skip to content

Commit

Permalink
Update flags for DebugSymbolsSmoke test for GraalVM 23.0 as well
Browse files Browse the repository at this point in the history
New behaviour backported to 23.0 as well
oracle/graal@eefeda1

Relates to Karm#154
  • Loading branch information
zakkak committed May 22, 2023
1 parent eb6a37a commit 0a99cb8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -846,21 +846,16 @@ public void nativeJVMTextProcessing(TestInfo testInfo) throws IOException, Inter

Map<String, String> 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...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -86,9 +86,9 @@ public class DebugSymbolsTest {
public static final String BASE_DIR = getBaseDir();

public enum DebugOptions {
TrackNodeSourcePosition_23_0("<DEBUG_FLAGS_23_0>", "-H:+TrackNodeSourcePosition"),
DebugCodeInfoUseSourceMappings_23_1("<DEBUG_FLAGS_23_1_a>", "-H:+DebugCodeInfoUseSourceMappings"),
OmitInlinedMethodDebugLineInfo_23_1("<DEBUG_FLAGS_23_1_b>", "-H:+OmitInlinedMethodDebugLineInfo");
TrackNodeSourcePosition_23_0("<DEBUG_FLAGS_23_0_a>", "-H:+TrackNodeSourcePosition"),
DebugCodeInfoUseSourceMappings_23_0("<DEBUG_FLAGS_23_0_b>", "-H:+DebugCodeInfoUseSourceMappings"),
OmitInlinedMethodDebugLineInfo_23_0("<DEBUG_FLAGS_23_0_c>", "-H:+OmitInlinedMethodDebugLineInfo");

public final String token;
final String replacement;
Expand Down Expand Up @@ -120,21 +120,16 @@ public void debugSymbolsSmokeGDB(TestInfo testInfo) throws IOException, Interrup

Map<String, String> 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...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit 0a99cb8

Please sign in to comment.