update the runtime paths to work in windows

the old paths contained a / at the beginning of the path e.g. "/C:/" but the expected path is "C:/" and due to this all test for the targets javascript, python and c# failed on windows.
This commit is contained in:
Andreas Jonson 2016-08-19 22:22:05 +02:00
parent 47e268dfea
commit 6e780c90bb
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/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

View File

@ -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);

View File

@ -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];

View File

@ -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];