fix appveyor build for es6
This commit is contained in:
parent
21cb5df94f
commit
a741dba79f
|
@ -16,13 +16,7 @@ build_script:
|
|||
after_build:
|
||||
- msbuild /target:pack /property:Configuration=Release /verbosity:detailed runtime/CSharp/runtime/CSharp/Antlr4.dotnet.sln
|
||||
test_script:
|
||||
- mvn install -Dtest=csharp.* --batch-mode
|
||||
- mvn install -Dtest=php.* -Dantlr-php-php="C:\tools\php\php.exe" --batch-mode
|
||||
- mvn install -Dtest=dart.* -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat" --batch-mode
|
||||
- mvn install -Dtest=python2.* -Dantlr-python2-python="C:\Python27\python.exe" --batch-mode
|
||||
- mvn install -Dtest=python3.* -Dantlr-python3-python="C:\Python35\python.exe" --batch-mode
|
||||
- mvn install -Dtest=go.* --batch-mode
|
||||
- mvn install -Dtest=java.* --batch-mode
|
||||
- mvn install -Dantlr-php-php="C:\tools\php\php.exe" -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat" -Dantlr-python2-python="C:\Python27\python.exe" -Dantlr-python3-python="C:\Python35\python.exe" --batch-mode
|
||||
artifacts:
|
||||
- path: 'runtime\**\*.nupkg'
|
||||
name: NuGet
|
|
@ -96,11 +96,15 @@ public abstract class BaseRuntimeTest {
|
|||
public void setUp() throws Exception {
|
||||
// From http://junit.sourceforge.net/javadoc/org/junit/Assume.html
|
||||
// "The default JUnit runner treats tests with failing assumptions as ignored"
|
||||
boolean ignored = descriptor.ignore(descriptor.getTarget());
|
||||
assumeFalse(checkIgnored());
|
||||
delegate.testSetUp();
|
||||
}
|
||||
|
||||
public boolean checkIgnored() {
|
||||
boolean ignored = TestContext.isUnsupportedTarget(descriptor.getTarget()) || descriptor.ignore(descriptor.getTarget());
|
||||
if(ignored)
|
||||
System.out.println("Ignore " + descriptor);
|
||||
assumeFalse(ignored);
|
||||
delegate.testSetUp();
|
||||
return ignored;
|
||||
}
|
||||
|
||||
@Rule
|
||||
|
|
|
@ -168,11 +168,6 @@ public abstract class BaseRuntimeTestDescriptor implements RuntimeTestDescriptor
|
|||
return false;
|
||||
}
|
||||
|
||||
protected boolean isAppVeyorCI() {
|
||||
return "true".equals(System.getenv("APPVEYOR"));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getTarget()+":"+getTestName();
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package org.antlr.v4.test.runtime;
|
||||
|
||||
public abstract class TestContext {
|
||||
|
||||
public static boolean isTravisCI() {
|
||||
return "true".equals(System.getenv("TRAVIS"));
|
||||
}
|
||||
|
||||
public static boolean isAppVeyorCI() {
|
||||
return "true".equals(System.getenv("APPVEYOR"));
|
||||
}
|
||||
|
||||
public static boolean isUnsupportedTarget(String target) {
|
||||
if(isAppVeyorCI())
|
||||
return !"CSharp".equals(target);
|
||||
// return target.matches("Cpp|Node");
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -34,6 +34,7 @@ import org.antlr.v4.semantics.SemanticPipeline;
|
|||
import org.antlr.v4.test.runtime.ErrorQueue;
|
||||
import org.antlr.v4.test.runtime.RuntimeTestSupport;
|
||||
import org.antlr.v4.test.runtime.StreamVacuum;
|
||||
import org.antlr.v4.test.runtime.TestContext;
|
||||
import org.antlr.v4.tool.ANTLRMessage;
|
||||
import org.antlr.v4.tool.DOTGenerator;
|
||||
import org.antlr.v4.tool.Grammar;
|
||||
|
@ -268,7 +269,7 @@ public class BaseNodeTest implements RuntimeTestSupport {
|
|||
public String execModule(String fileName) {
|
||||
try {
|
||||
String npmPath = locateNpm();
|
||||
if(!isTravisCI()) {
|
||||
if(!TestContext.isTravisCI()) {
|
||||
installRuntime(npmPath);
|
||||
registerRuntime(npmPath);
|
||||
}
|
||||
|
@ -311,10 +312,6 @@ public class BaseNodeTest implements RuntimeTestSupport {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isTravisCI() {
|
||||
return "true".equals(System.getenv("TRAVIS"));
|
||||
}
|
||||
|
||||
private void installRuntime(String npmPath) throws IOException, InterruptedException {
|
||||
String runtimePath = locateRuntime();
|
||||
ProcessBuilder builder = new ProcessBuilder(npmPath, "install");
|
||||
|
|
Loading…
Reference in New Issue