Merge pull request #1268 from andjo403/windowsPaths

update the runtime paths to work in windows
This commit is contained in:
Terence Parr 2016-09-23 13:12:28 -07:00 committed by GitHub
commit 5b461ddd77
4 changed files with 18 additions and 0 deletions

View File

@ -92,3 +92,4 @@ YYYY/MM/DD, github id, Full name, email
2016/03/27, beardlybread, Bradley Steinbacher, bradley.j.steinbacher@gmail.com 2016/03/27, beardlybread, Bradley Steinbacher, bradley.j.steinbacher@gmail.com
2016/03/29, msteiger, Martin Steiger, antlr@martin-steiger.de 2016/03/29, msteiger, Martin Steiger, antlr@martin-steiger.de
2016/03/28, gagern, Martin von Gagern, gagern@ma.tum.de 2016/03/28, gagern, Martin von Gagern, gagern@ma.tum.de
2016/08/19, andjo403, Andreas Jonson, andjo403@hotmail.com

View File

@ -482,6 +482,9 @@ public abstract class BaseTest {
throw new RuntimeException("C# runtime project file not found!"); throw new RuntimeException("C# runtime project file not found!");
} }
String runtimeProjPath = runtimeProj.getPath(); String runtimeProjPath = runtimeProj.getPath();
if(isWindows()){
runtimeProjPath = runtimeProjPath.replaceFirst("/", "");
}
XPathExpression exp = XPathFactory.newInstance().newXPath() XPathExpression exp = XPathFactory.newInstance().newXPath()
.compile("/Project/ItemGroup/ProjectReference[@Include='" + runtimeName + "']"); .compile("/Project/ItemGroup/ProjectReference[@Include='" + runtimeName + "']");
Element node = (Element)exp.evaluate(prjXml, XPathConstants.NODE); Element node = (Element)exp.evaluate(prjXml, XPathConstants.NODE);

View File

@ -445,9 +445,16 @@ public abstract class BaseTest {
if ( runtimeSrc==null ) { if ( runtimeSrc==null ) {
throw new RuntimeException("Cannot find JavaScript runtime"); throw new RuntimeException("Cannot find JavaScript runtime");
} }
if(isWindows()){
return runtimeSrc.getPath().replaceFirst("/", "");
}
return runtimeSrc.getPath(); return runtimeSrc.getPath();
} }
private boolean isWindows() {
return System.getProperty("os.name").toLowerCase().contains("windows");
}
public void testErrors(String[] pairs, boolean printTree) { public void testErrors(String[] pairs, boolean printTree) {
for (int i = 0; i < pairs.length; i += 2) { for (int i = 0; i < pairs.length; i += 2) {
String input = pairs[i]; String input = pairs[i];

View File

@ -583,9 +583,16 @@ public abstract class BasePythonTest {
if ( runtimeSrc==null ) { if ( runtimeSrc==null ) {
throw new RuntimeException("Cannot find "+targetName+" runtime"); throw new RuntimeException("Cannot find "+targetName+" runtime");
} }
if(isWindows()){
return runtimeSrc.getPath().replaceFirst("/", "");
}
return runtimeSrc.getPath(); return runtimeSrc.getPath();
} }
private boolean isWindows() {
return System.getProperty("os.name").toLowerCase().contains("windows");
}
public void testErrors(String[] pairs, boolean printTree) { public void testErrors(String[] pairs, boolean printTree) {
for (int i = 0; i < pairs.length; i+=2) { for (int i = 0; i < pairs.length; i+=2) {
String input = pairs[i]; String input = pairs[i];