diff --git a/gradle.properties b/gradle.properties index c57deb686..169d2a5a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,5 @@ teavm.tests.decodeStack=false teavm.tests.optimized=true teavm.tests.minified=false teavm.tests.c=true -teavm.tests.wasm=true \ No newline at end of file +teavm.tests.wasm=true +teavm.tests.wasi=true \ No newline at end of file diff --git a/tests/run-wasi.sh b/tests/run-wasi.sh index 861388ff7..ee65f4a28 100755 --- a/tests/run-wasi.sh +++ b/tests/run-wasi.sh @@ -1 +1,2 @@ +mkdir -p build/wasi-testdir ~/.wasmtime/bin/wasmtime run --mapdir /::build/wasi-testdir $1 $2 \ No newline at end of file diff --git a/tests/src/test/java/org/teavm/classlib/java/io/FileOutputStreamTest.java b/tests/src/test/java/org/teavm/classlib/java/io/FileOutputStreamTest.java index 460b06076..29464f6ca 100644 --- a/tests/src/test/java/org/teavm/classlib/java/io/FileOutputStreamTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/io/FileOutputStreamTest.java @@ -27,7 +27,9 @@ import java.io.IOException; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) public class FileOutputStreamTest { @@ -282,6 +284,7 @@ public class FileOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void repeatedWrite() throws IOException { f = new File(System.getProperty("user.home"), "test.txt"); fos = new FileOutputStream(f); diff --git a/tests/src/test/java/org/teavm/classlib/java/io/FileTest.java b/tests/src/test/java/org/teavm/classlib/java/io/FileTest.java index 0e7ccf9db..00b46cffa 100644 --- a/tests/src/test/java/org/teavm/classlib/java/io/FileTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/io/FileTest.java @@ -36,7 +36,9 @@ import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.interop.PlatformMarker; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) public class FileTest { @@ -1664,6 +1666,7 @@ public class FileTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void renameToLjava_io_File() throws IOException { String base = tempDirectory.getPath(); File dir = new File(base, platformId); @@ -1749,6 +1752,7 @@ public class FileTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void setReadOnly() throws IOException { File f1 = null; File f2 = null; diff --git a/tests/src/test/java/org/teavm/classlib/java/io/PipedInputStreamTest.java b/tests/src/test/java/org/teavm/classlib/java/io/PipedInputStreamTest.java index 779401dab..8cf3c3790 100644 --- a/tests/src/test/java/org/teavm/classlib/java/io/PipedInputStreamTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/io/PipedInputStreamTest.java @@ -106,7 +106,7 @@ public class PipedInputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void available() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -133,6 +133,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void close() throws IOException { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -150,7 +151,7 @@ public class PipedInputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void connectLjava_io_PipedOutputStream() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -168,7 +169,7 @@ public class PipedInputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_read() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -186,7 +187,7 @@ public class PipedInputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_read$BII() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -208,6 +209,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void read$BII_2() throws IOException { PipedInputStream obj = new PipedInputStream(); try { @@ -221,6 +223,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void read$BII_3() throws IOException { PipedInputStream obj = new PipedInputStream(); try { @@ -234,6 +237,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void read$BII_4() throws IOException { PipedInputStream obj = new PipedInputStream(); try { @@ -375,7 +379,7 @@ public class PipedInputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void read_after_write_close() throws Exception { PipedInputStream in = new PipedInputStream(); PipedOutputStream out = new PipedOutputStream(); diff --git a/tests/src/test/java/org/teavm/classlib/java/io/PipedOutputStreamTest.java b/tests/src/test/java/org/teavm/classlib/java/io/PipedOutputStreamTest.java index 99487b19f..659f325f2 100644 --- a/tests/src/test/java/org/teavm/classlib/java/io/PipedOutputStreamTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/io/PipedOutputStreamTest.java @@ -90,13 +90,14 @@ public class PipedOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void constructorLjava_io_PipedInputStream() throws Exception { out = new PipedOutputStream(new PipedInputStream()); out.write('b'); } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void close() throws Exception { out = new PipedOutputStream(); reader = new PReader(out); @@ -118,6 +119,7 @@ public class PipedOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void connectLjava_io_PipedInputStream() { try { out = new PipedOutputStream(); @@ -132,7 +134,7 @@ public class PipedOutputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void flush() throws IOException { out = new PipedOutputStream(); reader = new PReader(out); @@ -145,7 +147,7 @@ public class PipedOutputStreamTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void write$BII() throws IOException { out = new PipedOutputStream(); reader = new PReader(out); @@ -157,6 +159,7 @@ public class PipedOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void test_writeI() throws IOException { out = new PipedOutputStream(); reader = new PReader(out); diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java index 1db855f46..753f5c0c6 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java @@ -32,7 +32,7 @@ import org.teavm.junit.TestPlatform; @EachTestCompiledSeparately public class ClassLoaderTest { @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void loadsResources() { assertEquals("q", loadResource("1")); assertEquals("qw", loadResource("2")); diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java index 58dfeea7e..b2e58bfc7 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java @@ -31,7 +31,7 @@ import org.teavm.junit.TeaVMTestRunner; import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) -@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) +@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public class ClassTest { @Test public void classNameEvaluated() { diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java index cd5275bd7..659011d25 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java @@ -18,9 +18,12 @@ package org.teavm.classlib.java.lang; import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class MathTest { private static void sameDouble(double a, double b) { assertEquals(Double.valueOf(a), Double.valueOf(b)); diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java index e1b180245..42d4cb338 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java @@ -23,7 +23,9 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.EachTestCompiledSeparately; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately @@ -74,6 +76,7 @@ public class ObjectTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void waitWorks() throws InterruptedException { long start = System.currentTimeMillis(); final Object lock = new Object(); diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java index 544ff424e..a1e30fdbf 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java @@ -24,10 +24,13 @@ import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.EachTestCompiledSeparately; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately +@SkipPlatform(TestPlatform.WASI) public class ThreadTest { @Test public void sleeps() throws InterruptedException { diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/invoke/SerializedLambdaTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/invoke/SerializedLambdaTest.java index 972b2a22d..aa5778e03 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/invoke/SerializedLambdaTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/invoke/SerializedLambdaTest.java @@ -30,7 +30,7 @@ import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately -@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) +@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public class SerializedLambdaTest { @Test public void serializableLambdaHasWriteReplaceMethod() throws NoSuchMethodException, InvocationTargetException, diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java index 9e47488bd..7270613cb 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java @@ -43,7 +43,7 @@ public class ArrayTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void setWorks() { Object array = Array.newInstance(String.class, 2); Array.set(array, 0, "foo"); @@ -52,7 +52,7 @@ public class ArrayTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void setPrimitiveWorks() { Object array = Array.newInstance(int.class, 2); Array.set(array, 0, 23); diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ConstructorTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ConstructorTest.java index a86ac4262..9d24f2cef 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ConstructorTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ConstructorTest.java @@ -32,7 +32,7 @@ import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately -@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) +@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public class ConstructorTest { @Test public void constructorsEnumerated() { diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/FieldTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/FieldTest.java index 023179364..a99078cef 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/FieldTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/FieldTest.java @@ -29,7 +29,7 @@ import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately -@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) +@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public class FieldTest { @Test public void fieldsEnumerated() { diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/MethodTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/MethodTest.java index 9f9e2ba7d..567f3c0c3 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/MethodTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/MethodTest.java @@ -31,7 +31,7 @@ import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately -@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) +@SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public class MethodTest { @Test public void methodsEnumerated() { diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java index d585ef3be..e45eb492d 100644 --- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java @@ -41,9 +41,12 @@ import java.math.MathContext; import java.math.RoundingMode; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class BigDecimalArithmeticTest { /** * Add two numbers of equal positive scales diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java index cc385c90b..0420ae1ef 100644 --- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java @@ -46,9 +46,12 @@ import java.math.MathContext; import java.math.RoundingMode; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class BigDecimalCompareTest { /** * Abs() of a negative BigDecimal diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java index 33195b950..3f9c75bda 100644 --- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java @@ -44,9 +44,12 @@ import java.math.MathContext; import java.math.RoundingMode; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class BigDecimalConstructorsTest { /** * check ONE diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java index 6af1b1685..6ea05c0a1 100644 --- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java @@ -44,9 +44,12 @@ import java.math.BigInteger; import java.math.RoundingMode; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class BigDecimalScaleOperationsTest { /** * Check the default scale diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java index 4107bfcda..d81b55cf7 100644 --- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java @@ -40,9 +40,12 @@ import static org.junit.Assert.assertTrue; import java.math.BigInteger; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class BigIntegerToStringTest { /** * If 36 < radix < 2 it should be set to 10 diff --git a/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java index 6a59645de..c07dd3106 100644 --- a/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java @@ -27,12 +27,15 @@ import java.util.Currency; import java.util.Locale; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMProperties; import org.teavm.junit.TeaVMProperty; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @TeaVMProperties(@TeaVMProperty(key = "java.util.Locale.available", value = "en, en_US, en_GB, ru, ru_RU")) +@SkipPlatform(TestPlatform.WASI) public class DecimalFormatTest { private static DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH); diff --git a/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java index 0925eea46..533f1124f 100644 --- a/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java @@ -38,9 +38,12 @@ import java.util.TimeZone; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class MessageFormatTest { private MessageFormat format1; private MessageFormat format2; diff --git a/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java index f65de08fa..b3e35c761 100644 --- a/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java @@ -23,13 +23,16 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.EachTestCompiledSeparately; import org.teavm.junit.SkipJVM; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMProperties; import org.teavm.junit.TeaVMProperty; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @TeaVMProperties(@TeaVMProperty(key = "java.util.Locale.available", value = "en, en_US, en_GB, ru, ru_RU")) @EachTestCompiledSeparately +@SkipPlatform(TestPlatform.WASI) public class NumberFormatTest { @Test public void formatsNumber() { diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java index 27c00cbe8..c3d5cf27d 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java @@ -56,7 +56,9 @@ import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; import org.testng.annotations.Test; /** @@ -64,6 +66,7 @@ import org.testng.annotations.Test; */ @Test @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class TestClockTick extends AbstractTest { private static final ZoneId MOSCOW = ZoneId.of("Europe/Moscow"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java index ad5611008..9485c5036 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java @@ -310,7 +310,7 @@ public class TestDateTimesImplementation { } @Test(dataProvider = "safeMultiplyLongLongProviderOverflow", expectedExceptions = ArithmeticException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_safeMultiplyLongLong_overflow(long a, long b) { Jdk8Methods.safeMultiply(a, b); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java index 105988673..7ac4dfc2a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java @@ -944,7 +944,7 @@ public class TestLocalDate extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_plus_longPeriodUnit_null() { test2007x07x15.plus(1, (TemporalUnit) null); } @@ -1305,7 +1305,7 @@ public class TestLocalDate extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_minus_longPeriodUnit_null() { test2007x07x15.minus(1, (TemporalUnit) null); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java index 0573ec416..499724be0 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java @@ -1261,7 +1261,7 @@ public class TestLocalDateTime extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_plus_longPeriodUnit_null() { test2007x07x15x12x30x40x987654321.plus(1, null); } @@ -1972,7 +1972,7 @@ public class TestLocalDateTime extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_minus_longPeriodUnit_null() { test2007x07x15x12x30x40x987654321.minus(1, null); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java index c8d975219..de85bd485 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java @@ -668,7 +668,7 @@ public class TestOffsetTime extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_with_TemporalField_null() { test11x30x59x500pone.with((TemporalField) null, 0); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java index 849468d7b..2b404e31e 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java @@ -1456,7 +1456,7 @@ public class TestZonedDateTime extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_plus_longUnit_null() { testDateTimeParis.plus(0, null); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java index e12e06a34..aac52cb2c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java @@ -710,7 +710,7 @@ public class TestYear extends AbstractDateTimeTest { } @Test(expectedExceptions = NullPointerException.class) - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void test_compareTo_nullYear() { Year doy = null; Year test = Year.of(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java b/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java index 061a947a9..cf08c8c76 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java @@ -42,9 +42,12 @@ import java.util.Locale; import java.util.TimeZone; import org.junit.Test; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class CalendarTest { Locale defaultLocale; diff --git a/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java b/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java index 48015fec6..caa3ec7b3 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java @@ -26,6 +26,7 @@ import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately +@SkipPlatform(TestPlatform.WASI) public class DateTest { @SuppressWarnings("deprecation") @Test diff --git a/tests/src/test/java/org/teavm/classlib/java/util/FormatterTest.java b/tests/src/test/java/org/teavm/classlib/java/util/FormatterTest.java index 8bc6fefc1..72218ad9a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/FormatterTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/FormatterTest.java @@ -110,7 +110,7 @@ public class FormatterTest { } @Test - @SkipPlatform(TestPlatform.WEBASSEMBLY) + @SkipPlatform({TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void formatsChar() { assertEquals("x: Y:\uDBFF\uDFFF ", new Formatter().format("%c:%3C:%-3c", 'x', 'y', 0x10ffff).toString()); diff --git a/tests/src/test/java/org/teavm/classlib/java/util/RandomTest.java b/tests/src/test/java/org/teavm/classlib/java/util/RandomTest.java index 3fa46c418..b44306b3b 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/RandomTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/RandomTest.java @@ -32,6 +32,7 @@ import org.teavm.junit.TeaVMTestRunner; import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) +@SkipPlatform(TestPlatform.WASI) public class RandomTest { @Test public void testDoubles() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java b/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java index 9d46aee2a..724d5a20c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java @@ -29,10 +29,13 @@ import java.util.concurrent.BlockingQueue; import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.EachTestCompiledSeparately; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately +@SkipPlatform(TestPlatform.WASI) public class ArrayBlockingQueueTest { @Test public void constructed() { diff --git a/tests/src/test/java/org/teavm/metaprogramming/test/MetaprogrammingTest.java b/tests/src/test/java/org/teavm/metaprogramming/test/MetaprogrammingTest.java index e1014b825..32220ab14 100644 --- a/tests/src/test/java/org/teavm/metaprogramming/test/MetaprogrammingTest.java +++ b/tests/src/test/java/org/teavm/metaprogramming/test/MetaprogrammingTest.java @@ -484,7 +484,7 @@ public class MetaprogrammingTest { private static int counter; @Test - @SkipPlatform(TestPlatform.WEBASSEMBLY) + @SkipPlatform({TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void arrayTypeSelected() { assertEquals(String[].class, createInstance(String.class, 1).getClass()); assertEquals(String[][].class, createInstance(String[].class, 1).getClass()); diff --git a/tests/src/test/java/org/teavm/vm/VMTest.java b/tests/src/test/java/org/teavm/vm/VMTest.java index 1412df1f0..69f4b72ad 100644 --- a/tests/src/test/java/org/teavm/vm/VMTest.java +++ b/tests/src/test/java/org/teavm/vm/VMTest.java @@ -258,7 +258,7 @@ public class VMTest { @Test @SkipJVM - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void asyncClinit() { assertEquals(0, initCount); assertEquals("foo", AsyncClinitClass.foo()); @@ -270,13 +270,13 @@ public class VMTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void asyncClinitField() { assertEquals("ok", AsyncClinitClass.state); } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void asyncClinitInstance() { AsyncClinitClass acl = new AsyncClinitClass(); assertEquals("ok", AsyncClinitClass.state); @@ -284,7 +284,7 @@ public class VMTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void asyncWait() { AsyncClinitClass acl = new AsyncClinitClass(); acl.doWait(); @@ -293,7 +293,7 @@ public class VMTest { @Test @SkipJVM - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void loopAndExceptionPhi() { int[] a = createArray(); int s = 0; @@ -312,7 +312,7 @@ public class VMTest { @Test @SkipJVM - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void asyncTryCatch() { try { throwExceptionAsync(); @@ -324,7 +324,7 @@ public class VMTest { @Test @SkipJVM - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void asyncExceptionHandler() { try { throw new RuntimeException("OK"); @@ -530,7 +530,7 @@ public class VMTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void indirectDefaultMethod() { StringBuilder sb = new StringBuilder(); for (FirstPath o : new FirstPath[] { new PathJoint(), new FirstPathOptimizationPrevention() }) { @@ -540,7 +540,7 @@ public class VMTest { } @Test - @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY}) + @SkipPlatform({TestPlatform.C, TestPlatform.WEBASSEMBLY, TestPlatform.WASI}) public void indirectDefaultMethodSubclass() { StringBuilder sb = new StringBuilder(); for (FirstPath o : new FirstPath[] { new PathJointSubclass(), new FirstPathOptimizationPrevention() }) { @@ -615,6 +615,7 @@ public class VMTest { } @Test + @SkipPlatform(TestPlatform.WASI) public void arrayMonitor() throws InterruptedException { int[] array = { 1, 2, 3 }; synchronized (array) {