Commit 2c98e799 authored by Evan W. Patton's avatar Evan W. Patton Committed by ellelili2025

Fix build server tests on Windows

Change-Id: I85ed935936facb8d337b5abc471c5227e3de21d9
parent c5b3e2d2
...@@ -22,13 +22,15 @@ import static org.junit.Assert.assertEquals; ...@@ -22,13 +22,15 @@ import static org.junit.Assert.assertEquals;
public class YailAndroidTest { public class YailAndroidTest {
private Scheme scheme; private Scheme scheme;
private static final String YAIL_SCHEME_TESTS = TestUtils.APP_INVENTOR_ROOT_DIR + private static final String YAIL_SCHEME_TESTS =
TestUtils.windowsToUnix(TestUtils.APP_INVENTOR_ROOT_DIR) +
"/buildserver/tests/com/google/appinventor/buildserver/YailEvalTest.scm"; "/buildserver/tests/com/google/appinventor/buildserver/YailEvalTest.scm";
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
scheme = new Scheme(); scheme = new Scheme();
String yailRuntimeLibrary = Compiler.getResource(Compiler.YAIL_RUNTIME); String yailRuntimeLibrary = Compiler.getResource(Compiler.YAIL_RUNTIME);
yailRuntimeLibrary = TestUtils.windowsToUnix(yailRuntimeLibrary);
try { try {
scheme.eval("(load \"" + yailRuntimeLibrary + "\")"); scheme.eval("(load \"" + yailRuntimeLibrary + "\")");
scheme.eval("(load \"" + YAIL_SCHEME_TESTS + "\")"); scheme.eval("(load \"" + YAIL_SCHEME_TESTS + "\")");
......
...@@ -32,13 +32,15 @@ import java.util.Map; ...@@ -32,13 +32,15 @@ import java.util.Map;
public class YailEvalTest extends TestCase { public class YailEvalTest extends TestCase {
private Scheme scheme; private Scheme scheme;
private static final String YAIL_SCHEME_TESTS = TestUtils.APP_INVENTOR_ROOT_DIR + private static final String YAIL_SCHEME_TESTS =
TestUtils.windowsToUnix(TestUtils.APP_INVENTOR_ROOT_DIR) +
"/buildserver/tests/com/google/appinventor/buildserver/YailEvalTest.scm"; "/buildserver/tests/com/google/appinventor/buildserver/YailEvalTest.scm";
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
scheme = new Scheme(); scheme = new Scheme();
String yailRuntimeLibrary = Compiler.getResource(Compiler.YAIL_RUNTIME); String yailRuntimeLibrary = Compiler.getResource(Compiler.YAIL_RUNTIME);
yailRuntimeLibrary = TestUtils.windowsToUnix(yailRuntimeLibrary);
try { try {
scheme.eval("(load \"" + yailRuntimeLibrary + "\")"); scheme.eval("(load \"" + yailRuntimeLibrary + "\")");
scheme.eval("(load \"" + YAIL_SCHEME_TESTS + "\")"); scheme.eval("(load \"" + YAIL_SCHEME_TESTS + "\")");
......
...@@ -31,8 +31,11 @@ public class TestUtils { ...@@ -31,8 +31,11 @@ public class TestUtils {
dir = dir.getParentFile(); dir = dir.getParentFile();
} }
assert false; throw new RuntimeException("Unable to locate App Inventor root");
return null; // to make compiler happy }
public static String windowsToUnix(String path) {
return path.replaceAll("\\\\", "/");
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment