mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-21 01:00:54 +08:00
Fix running tests in wasm
This commit is contained in:
parent
9ecb3ad817
commit
d7cae4af55
@ -39,11 +39,23 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
systemProperty("teavm.junit.target", "${project.buildDir.absolutePath }/js-tests")
|
||||
systemProperty("teavm.junit.js.runner", "browser-chrome")
|
||||
systemProperty("teavm.junit.target", "${project.buildDir.absolutePath }/teavm-tests")
|
||||
systemProperty("teavm.junit.threads", "1")
|
||||
systemProperty("teavm.junit.minified", providers.gradleProperty("teavm.tests.minified"))
|
||||
systemProperty("teavm.junit.optimized", providers.gradleProperty("teavm.tests.optimized"))
|
||||
systemProperty("teavm.junit.js.decodeStack", providers.gradleProperty("teavm.tests.decodeStack"))
|
||||
val browser = providers.gradleProperty("teavm.tests.browser").orElse("browser-chrome").get()
|
||||
|
||||
systemProperty("teavm.junit.js", providers.gradleProperty("teavm.tests.wasm").orElse("true").get())
|
||||
systemProperty("teavm.junit.js.runner", browser)
|
||||
systemProperty("teavm.junit.minified", providers.gradleProperty("teavm.tests.minified").orElse("false").get())
|
||||
systemProperty("teavm.junit.optimized", providers.gradleProperty("teavm.tests.optimized").orElse("false").get())
|
||||
systemProperty("teavm.junit.js.decodeStack", providers.gradleProperty("teavm.tests.decodeStack")
|
||||
.orElse("false").get())
|
||||
|
||||
systemProperty("teavm.junit.wasm", providers.gradleProperty("teavm.tests.wasm").orElse("false").get())
|
||||
systemProperty("teavm.junit.wasm.runner", browser)
|
||||
|
||||
systemProperty("teavm.junit.wasi", providers.gradleProperty("teavm.tests.wasi").orElse("false").get())
|
||||
systemProperty("teavm.junit.wasi.runner", providers.gradleProperty("teavm.tests.wasi.runner")
|
||||
.orElse("./run-wasi.sh").get())
|
||||
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
}
|
@ -1 +1 @@
|
||||
~/.wasmtime/bin/wasmtime run --mapdir /::target/wasi-testdir $1 $2
|
||||
~/.wasmtime/bin/wasmtime run --mapdir /::build/wasi-testdir $1 $2
|
@ -41,7 +41,6 @@ import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
@ -128,7 +127,6 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
||||
private File outputDir;
|
||||
private Map<Method, Description> descriptions = new HashMap<>();
|
||||
private static Map<RunKind, RunnerKindInfo> runners = new HashMap<>();
|
||||
private static ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
|
||||
private CountDownLatch latch;
|
||||
private List<Method> filteredChildren;
|
||||
private ReferenceCache referenceCache = new ReferenceCache();
|
||||
@ -1046,14 +1044,6 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
||||
}
|
||||
}
|
||||
|
||||
private static void cleanupRunner(RunKind kind) {
|
||||
synchronized (TeaVMTestRunner.class) {
|
||||
RunnerKindInfo info = runners.get(kind);
|
||||
info.runner.stop();
|
||||
info.runner = null;
|
||||
}
|
||||
}
|
||||
|
||||
private File getOutputPath(Method method) {
|
||||
File path = outputDir;
|
||||
path = new File(path, testClass.getName().replace('.', '/'));
|
||||
|
Loading…
Reference in New Issue
Block a user