From 1c560361714cd198897f3a157fd519e1214e4210 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 2 Oct 2023 08:30:52 +0200 Subject: [PATCH] Suppress tests that are failing on C backend --- .../teavm/classlib/java/io/PipedInputStreamTest.java | 6 ++++++ .../teavm/classlib/java/io/PipedOutputStreamTest.java | 5 +++++ .../org/teavm/classlib/java/lang/ClassLoaderTest.java | 4 ++++ .../java/org/teavm/classlib/java/lang/ClassTest.java | 3 +++ .../java/lang/invoke/SerializedLambdaTest.java | 3 +++ .../teavm/classlib/java/lang/reflect/ArrayTest.java | 4 ++++ .../classlib/java/lang/reflect/ConstructorTest.java | 3 +++ .../teavm/classlib/java/lang/reflect/FieldTest.java | 3 +++ .../teavm/classlib/java/lang/reflect/MethodTest.java | 3 +++ .../java/time/TestDateTimesImplementation.java | 3 +++ .../java/org/teavm/classlib/java/util/Base64Test.java | 3 +++ .../java/org/teavm/classlib/java/util/MapTest.java | 3 +++ .../java/org/teavm/classlib/java/util/RandomTest.java | 4 ++++ tests/src/test/java/org/teavm/vm/VMTest.java | 11 +++++++++++ 14 files changed, 58 insertions(+) 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 15be22fc1..acbf970c0 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 @@ -25,7 +25,9 @@ import org.junit.After; 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 @@ -104,6 +106,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void available() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -147,6 +150,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void connectLjava_io_PipedOutputStream() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -164,6 +168,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void test_read() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); @@ -181,6 +186,7 @@ public class PipedInputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void test_read$BII() throws Exception { pis = new PipedInputStream(); pos = 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 48f2d0a6c..15168226d 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 @@ -26,7 +26,9 @@ import org.junit.After; 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 @@ -94,6 +96,7 @@ public class PipedOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void close() throws Exception { out = new PipedOutputStream(); reader = new PReader(out); @@ -129,6 +132,7 @@ public class PipedOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void flush() throws IOException { out = new PipedOutputStream(); reader = new PReader(out); @@ -141,6 +145,7 @@ public class PipedOutputStreamTest { } @Test + @SkipPlatform(TestPlatform.C) public void write$BII() 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 7d99c0d71..6404f093a 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 @@ -24,12 +24,15 @@ import java.io.InputStreamReader; 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 public class ClassLoaderTest { @Test + @SkipPlatform(TestPlatform.C) public void loadsResources() { assertEquals("q", loadResource("1")); assertEquals("qw", loadResource("2")); @@ -43,6 +46,7 @@ public class ClassLoaderTest { } @Test + @SkipPlatform(TestPlatform.C) public void returnsNullForNonExistentResource() { InputStream input = ClassLoader.getSystemClassLoader().getResourceAsStream("non-existent-resource.txt"); assertNull(input); 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 b9ef263f3..521f77681 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 @@ -26,9 +26,12 @@ import java.lang.annotation.RetentionPolicy; import java.util.Set; 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.C) public class ClassTest { @Test public void classNameEvaluated() { 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 b85db1dbb..ed0a81151 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 @@ -24,10 +24,13 @@ import java.util.function.Function; 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.C) 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 cb5a7cb6e..00313747f 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 @@ -21,7 +21,9 @@ import java.lang.reflect.Array; 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 @@ -41,6 +43,7 @@ public class ArrayTest { } @Test + @SkipPlatform(TestPlatform.C) public void setWorks() { Object array = Array.newInstance(String.class, 2); Array.set(array, 0, "foo"); @@ -49,6 +52,7 @@ public class ArrayTest { } @Test + @SkipPlatform(TestPlatform.C) 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 d818ec001..332b6ac15 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 @@ -26,10 +26,13 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.classlib.support.Reflectable; 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.C) 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 5569cdf86..e162698fd 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 @@ -23,10 +23,13 @@ import org.junit.runner.RunWith; import org.teavm.classlib.support.Reflectable; import org.teavm.junit.EachTestCompiledSeparately; import org.teavm.junit.SkipJVM; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately +@SkipPlatform(TestPlatform.C) 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 0257010c0..d8d15414b 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 @@ -25,10 +25,13 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.classlib.support.Reflectable; 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.C) public class MethodTest { @Test public void methodsEnumerated() { 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 6c300d941..6535a684d 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 @@ -48,7 +48,9 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import org.junit.runner.RunWith; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.threeten.bp.jdk8.Jdk8Methods; @@ -308,6 +310,7 @@ public class TestDateTimesImplementation { } @Test(dataProvider = "safeMultiplyLongLongProviderOverflow", expectedExceptions = ArithmeticException.class) + @SkipPlatform(TestPlatform.C) public void test_safeMultiplyLongLong_overflow(long a, long b) { Jdk8Methods.safeMultiply(a, b); } diff --git a/tests/src/test/java/org/teavm/classlib/java/util/Base64Test.java b/tests/src/test/java/org/teavm/classlib/java/util/Base64Test.java index de94ef0c0..a3455a9e4 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/Base64Test.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/Base64Test.java @@ -20,9 +20,12 @@ import java.nio.charset.StandardCharsets; import java.util.Base64; 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.C) public class Base64Test { @Test public void decoderWorks() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/MapTest.java b/tests/src/test/java/org/teavm/classlib/java/util/MapTest.java index 30c7688bc..4afa0b14d 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/MapTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/MapTest.java @@ -26,7 +26,9 @@ import java.util.Map; import java.util.TreeMap; 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 MapTest { @@ -54,6 +56,7 @@ public class MapTest { } @Test + @SkipPlatform(TestPlatform.C) public void copyOfWorks() { testOf(new String[0], Map.copyOf(new HashMap<>())); testOf(new String[] { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a" }, 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 eb85b5ac7..3fa46c418 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 @@ -27,7 +27,9 @@ import java.util.stream.IntStream; import java.util.stream.LongStream; 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 RandomTest { @@ -61,6 +63,7 @@ public class RandomTest { } @Test + @SkipPlatform(TestPlatform.C) public void testIntegers() { Random random = new Random(); int[] ints = IntStream.range(0, 10000).map(i -> random.nextInt()) @@ -99,6 +102,7 @@ public class RandomTest { } @Test + @SkipPlatform(TestPlatform.C) public void testLongs() { Random random = new Random(); long[] longs = IntStream.range(0, 10000).mapToLong(i -> random.nextLong()) diff --git a/tests/src/test/java/org/teavm/vm/VMTest.java b/tests/src/test/java/org/teavm/vm/VMTest.java index 0e60fed5f..392c49b3d 100644 --- a/tests/src/test/java/org/teavm/vm/VMTest.java +++ b/tests/src/test/java/org/teavm/vm/VMTest.java @@ -30,7 +30,9 @@ import org.teavm.interop.AsyncCallback; import org.teavm.jso.JSBody; import org.teavm.junit.EachTestCompiledSeparately; import org.teavm.junit.SkipJVM; +import org.teavm.junit.SkipPlatform; import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.TestPlatform; @RunWith(TeaVMTestRunner.class) @EachTestCompiledSeparately @@ -253,6 +255,7 @@ public class VMTest { @Test @SkipJVM + @SkipPlatform(TestPlatform.C) public void asyncClinit() { assertEquals(0, initCount); assertEquals("foo", AsyncClinitClass.foo()); @@ -264,11 +267,13 @@ public class VMTest { } @Test + @SkipPlatform(TestPlatform.C) public void asyncClinitField() { assertEquals("ok", AsyncClinitClass.state); } @Test + @SkipPlatform(TestPlatform.C) public void asyncClinitInstance() { AsyncClinitClass acl = new AsyncClinitClass(); assertEquals("ok", AsyncClinitClass.state); @@ -276,6 +281,7 @@ public class VMTest { } @Test + @SkipPlatform(TestPlatform.C) public void asyncWait() { AsyncClinitClass acl = new AsyncClinitClass(); acl.doWait(); @@ -284,6 +290,7 @@ public class VMTest { @Test @SkipJVM + @SkipPlatform(TestPlatform.C) public void loopAndExceptionPhi() { int[] a = createArray(); int s = 0; @@ -302,6 +309,7 @@ public class VMTest { @Test @SkipJVM + @SkipPlatform(TestPlatform.C) public void asyncTryCatch() { try { throwExceptionAsync(); @@ -313,6 +321,7 @@ public class VMTest { @Test @SkipJVM + @SkipPlatform(TestPlatform.C) public void asyncExceptionHandler() { try { throw new RuntimeException("OK"); @@ -518,6 +527,7 @@ public class VMTest { } @Test + @SkipPlatform(TestPlatform.C) public void indirectDefaultMethod() { StringBuilder sb = new StringBuilder(); for (FirstPath o : new FirstPath[] { new PathJoint(), new FirstPathOptimizationPrevention() }) { @@ -527,6 +537,7 @@ public class VMTest { } @Test + @SkipPlatform(TestPlatform.C) public void indirectDefaultMethodSubclass() { StringBuilder sb = new StringBuilder(); for (FirstPath o : new FirstPath[] { new PathJointSubclass(), new FirstPathOptimizationPrevention() }) {