Skip to content

Commit

Permalink
Use runtimePath instead of targetClassesPath for runtimes' sources
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kochurkin <[email protected]>
  • Loading branch information
KvanTTT committed Jun 25, 2022
1 parent 22cbf3c commit d287f1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
import java.util.*;

import static org.antlr.v4.test.runtime.FileUtils.*;
import static org.antlr.v4.test.runtime.RuntimeTestUtils.FileSeparator;
import static org.antlr.v4.test.runtime.RuntimeTestUtils.TempDirectory;
import static org.antlr.v4.test.runtime.RuntimeTestUtils.*;

public abstract class RuntimeRunner implements AutoCloseable {
public abstract String getLanguage();
Expand Down Expand Up @@ -93,7 +92,6 @@ public void close() {
private final static Object runtimeInitLockObject = new Object();

public final static String cacheDirectory;
public final static Path targetClassesPath;

private static class InitializationStatus {
public final Object lockObject = new Object();
Expand All @@ -104,7 +102,6 @@ private static class InitializationStatus {
private final static HashMap<String, InitializationStatus> runtimeInitializationStatuses = new HashMap<>();

static {
targetClassesPath = Paths.get(RuntimeTestUtils.runtimeTestsuitePath.toString(), "target", "classes");
cacheDirectory = new File(System.getProperty("java.io.tmpdir"), "ANTLR-runtime-testsuite-cache").getAbsolutePath();
}

Expand All @@ -121,7 +118,7 @@ protected final String getRuntimePath() {
}

public static String getRuntimePath(String language) {
return targetClassesPath.toString() + FileSeparator + language;
return runtimePath.toString() + FileSeparator + language;
}

public State run(RunOptions runOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public abstract class RuntimeTestUtils {
public static final String FileSeparator = System.getProperty("file.separator");
public static final String TempDirectory = System.getProperty("java.io.tmpdir");

public final static Path runtimePath;
public final static Path runtimeTestsuitePath;
public final static Path resourcePath;

Expand All @@ -49,6 +50,7 @@ public abstract class RuntimeTestUtils {
runtimeTestsuitePath = Paths.get("..", "runtime-testsuite").normalize();
}

runtimePath = Paths.get(runtimeTestsuitePath.toString(), "..", "runtime").normalize();
resourcePath = Paths.get(runtimeTestsuitePath.toString(), "resources");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public String getTestFileName() {

static {
String swiftRuntimePath = getRuntimePath("Swift");
antlrRuntimePath = Paths.get(swiftRuntimePath, "..", "..", "..", "..").normalize().toString();
antlrRuntimePath = Paths.get(swiftRuntimePath, "..", "..").normalize().toString();
String dylibPath = antlrRuntimePath + "/.build/release/";
initPackageArgs = new String[]{"swift", "package", "init", "--type", "executable"};
buildProjectArgs = new String[]{"swift", "build", "-c", "release", "-Xswiftc", "-I" + dylibPath, "-Xlinker", "-L" + dylibPath,
Expand Down

0 comments on commit d287f1c

Please sign in to comment.