forked from jasder/antlr
Merge pull request #1268 from andjo403/windowsPaths
update the runtime paths to work in windows
This commit is contained in:
commit
5b461ddd77
|
@ -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/29, msteiger, Martin Steiger, antlr@martin-steiger.de
|
||||
2016/03/28, gagern, Martin von Gagern, gagern@ma.tum.de
|
||||
2016/08/19, andjo403, Andreas Jonson, andjo403@hotmail.com
|
||||
|
|
|
@ -482,6 +482,9 @@ public abstract class BaseTest {
|
|||
throw new RuntimeException("C# runtime project file not found!");
|
||||
}
|
||||
String runtimeProjPath = runtimeProj.getPath();
|
||||
if(isWindows()){
|
||||
runtimeProjPath = runtimeProjPath.replaceFirst("/", "");
|
||||
}
|
||||
XPathExpression exp = XPathFactory.newInstance().newXPath()
|
||||
.compile("/Project/ItemGroup/ProjectReference[@Include='" + runtimeName + "']");
|
||||
Element node = (Element)exp.evaluate(prjXml, XPathConstants.NODE);
|
||||
|
|
|
@ -445,9 +445,16 @@ public abstract class BaseTest {
|
|||
if ( runtimeSrc==null ) {
|
||||
throw new RuntimeException("Cannot find JavaScript runtime");
|
||||
}
|
||||
if(isWindows()){
|
||||
return runtimeSrc.getPath().replaceFirst("/", "");
|
||||
}
|
||||
return runtimeSrc.getPath();
|
||||
}
|
||||
|
||||
private boolean isWindows() {
|
||||
return System.getProperty("os.name").toLowerCase().contains("windows");
|
||||
}
|
||||
|
||||
public void testErrors(String[] pairs, boolean printTree) {
|
||||
for (int i = 0; i < pairs.length; i += 2) {
|
||||
String input = pairs[i];
|
||||
|
|
|
@ -583,9 +583,16 @@ public abstract class BasePythonTest {
|
|||
if ( runtimeSrc==null ) {
|
||||
throw new RuntimeException("Cannot find "+targetName+" runtime");
|
||||
}
|
||||
if(isWindows()){
|
||||
return runtimeSrc.getPath().replaceFirst("/", "");
|
||||
}
|
||||
return runtimeSrc.getPath();
|
||||
}
|
||||
|
||||
private boolean isWindows() {
|
||||
return System.getProperty("os.name").toLowerCase().contains("windows");
|
||||
}
|
||||
|
||||
public void testErrors(String[] pairs, boolean printTree) {
|
||||
for (int i = 0; i < pairs.length; i+=2) {
|
||||
String input = pairs[i];
|
||||
|
|
Loading…
Reference in New Issue