mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
junit: don't start browser if corresponding test platforms disabled
This commit is contained in:
parent
ef359c3604
commit
997a31b683
|
@ -61,14 +61,17 @@ class CPlatformSupport extends TestPlatformSupport<CTarget> {
|
|||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isEnabled() {
|
||||
return Boolean.getBoolean(C_ENABLED);
|
||||
}
|
||||
|
||||
@Override
|
||||
List<TeaVMTestConfiguration<CTarget>> getConfigurations() {
|
||||
List<TeaVMTestConfiguration<CTarget>> configurations = new ArrayList<>();
|
||||
if (Boolean.getBoolean(C_ENABLED)) {
|
||||
configurations.add(TeaVMTestConfiguration.C_DEFAULT);
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.C_OPTIMIZED);
|
||||
}
|
||||
configurations.add(TeaVMTestConfiguration.C_DEFAULT);
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.C_OPTIMIZED);
|
||||
}
|
||||
return configurations;
|
||||
}
|
||||
|
|
|
@ -79,17 +79,20 @@ class JSPlatformSupport extends TestPlatformSupport<JavaScriptTarget> {
|
|||
return ".js";
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isEnabled() {
|
||||
return Boolean.parseBoolean(System.getProperty(JS_ENABLED, "true"));
|
||||
}
|
||||
|
||||
@Override
|
||||
List<TeaVMTestConfiguration<JavaScriptTarget>> getConfigurations() {
|
||||
List<TeaVMTestConfiguration<JavaScriptTarget>> configurations = new ArrayList<>();
|
||||
if (Boolean.parseBoolean(System.getProperty(JS_ENABLED, "true"))) {
|
||||
configurations.add(TeaVMTestConfiguration.JS_DEFAULT);
|
||||
if (Boolean.getBoolean(MINIFIED)) {
|
||||
configurations.add(TeaVMTestConfiguration.JS_MINIFIED);
|
||||
}
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.JS_OPTIMIZED);
|
||||
}
|
||||
configurations.add(TeaVMTestConfiguration.JS_DEFAULT);
|
||||
if (Boolean.getBoolean(MINIFIED)) {
|
||||
configurations.add(TeaVMTestConfiguration.JS_MINIFIED);
|
||||
}
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.JS_OPTIMIZED);
|
||||
}
|
||||
return configurations;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ final class PropertyNames {
|
|||
static final String PATH_PARAM = "teavm.junit.target";
|
||||
static final String JS_RUNNER = "teavm.junit.js.runner";
|
||||
static final String WASM_RUNNER = "teavm.junit.wasm.runner";
|
||||
static final String THREAD_COUNT = "teavm.junit.threads";
|
||||
static final String JS_ENABLED = "teavm.junit.js";
|
||||
static final String JS_DECODE_STACK = "teavm.junit.js.decodeStack";
|
||||
static final String C_ENABLED = "teavm.junit.c";
|
||||
|
|
|
@ -110,9 +110,11 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
|||
platforms.add(new CPlatformSupport(classSource, referenceCache));
|
||||
|
||||
for (var platform : platforms) {
|
||||
var runStrategy = platform.createRunStrategy(outputDir);
|
||||
if (runStrategy != null) {
|
||||
runners.put(platform.getPlatform(), runStrategy);
|
||||
if (platform.isEnabled()) {
|
||||
var runStrategy = platform.createRunStrategy(outputDir);
|
||||
if (runStrategy != null) {
|
||||
runners.put(platform.getPlatform(), runStrategy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -734,15 +736,14 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
|||
return new Failure(description, throwable);
|
||||
}
|
||||
|
||||
private boolean submitRun(TestRun run) throws IOException {
|
||||
private void submitRun(TestRun run) throws IOException {
|
||||
runsInCurrentClass.add(run);
|
||||
var strategy = runners.get(run.getKind());
|
||||
if (strategy == null) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
strategy.runTest(run);
|
||||
return true;
|
||||
}
|
||||
|
||||
private File getOutputPath(Method method, TestPlatformSupport<?> platform) {
|
||||
|
|
|
@ -45,6 +45,8 @@ abstract class TestPlatformSupport<T extends TeaVMTarget> {
|
|||
this.referenceCache = referenceCache;
|
||||
}
|
||||
|
||||
abstract boolean isEnabled();
|
||||
|
||||
abstract TestRunStrategy createRunStrategy(File outputDir);
|
||||
|
||||
abstract TestPlatform getPlatform();
|
||||
|
|
|
@ -55,14 +55,17 @@ class WasiPlatformSupport extends BaseWebAssemblyPlatformSupport {
|
|||
return "wasi";
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isEnabled() {
|
||||
return Boolean.getBoolean(WASI_ENABLED);
|
||||
}
|
||||
|
||||
@Override
|
||||
List<TeaVMTestConfiguration<WasmTarget>> getConfigurations() {
|
||||
List<TeaVMTestConfiguration<WasmTarget>> configurations = new ArrayList<>();
|
||||
if (Boolean.getBoolean(WASI_ENABLED)) {
|
||||
configurations.add(TeaVMTestConfiguration.WASM_DEFAULT);
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.WASM_OPTIMIZED);
|
||||
}
|
||||
configurations.add(TeaVMTestConfiguration.WASM_DEFAULT);
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.WASM_OPTIMIZED);
|
||||
}
|
||||
return configurations;
|
||||
}
|
||||
|
|
|
@ -61,14 +61,17 @@ class WebAssemblyPlatformSupport extends BaseWebAssemblyPlatformSupport {
|
|||
return "wasm";
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isEnabled() {
|
||||
return Boolean.getBoolean(WASM_ENABLED);
|
||||
}
|
||||
|
||||
@Override
|
||||
List<TeaVMTestConfiguration<WasmTarget>> getConfigurations() {
|
||||
List<TeaVMTestConfiguration<WasmTarget>> configurations = new ArrayList<>();
|
||||
if (Boolean.getBoolean(WASM_ENABLED)) {
|
||||
configurations.add(TeaVMTestConfiguration.WASM_DEFAULT);
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.WASM_OPTIMIZED);
|
||||
}
|
||||
configurations.add(TeaVMTestConfiguration.WASM_DEFAULT);
|
||||
if (Boolean.getBoolean(OPTIMIZED)) {
|
||||
configurations.add(TeaVMTestConfiguration.WASM_OPTIMIZED);
|
||||
}
|
||||
return configurations;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user