From afa58599ec7026bfc347f2b3482ab69364ea768f Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Thu, 10 Nov 2016 13:27:37 +0300 Subject: [PATCH] Specify target backend as JVM for SAM tests; mute other failed tests and regenerate tests. --- compiler/testData/codegen/box/casts/as.kt | 3 + compiler/testData/codegen/box/casts/asSafe.kt | 3 + compiler/testData/codegen/box/casts/is.kt | 3 + compiler/testData/codegen/box/casts/notIs.kt | 3 + .../codegen/box/dataClasses/kt5002.kt | 3 + .../box/dataClasses/toString/arrayParams.kt | 3 + .../testData/codegen/box/functions/kt1739.kt | 3 + .../testData/codegen/box/objects/kt1737.kt | 3 + .../testData/codegen/box/objects/kt2663_2.kt | 3 + .../sam/constructors/nonLiteralRunnable.kt | 2 + .../sam/constructors/nonTrivialRunnable.kt | 2 + .../codegen/box/sam/constructors/runnable.kt | 2 + .../constructors/runnableAccessingClosure1.kt | 2 + .../constructors/runnableAccessingClosure2.kt | 2 + .../box/sam/constructors/syntheticVsReal.kt | 2 + .../box/traits/traitImplGenericDelegation.kt | 4 + .../semantics/JsCodegenBoxTestGenerated.java | 98 ++++++++++--------- 17 files changed, 97 insertions(+), 44 deletions(-) diff --git a/compiler/testData/codegen/box/casts/as.kt b/compiler/testData/codegen/box/casts/as.kt index 72aa1ec2713..23ae5313ac2 100644 --- a/compiler/testData/codegen/box/casts/as.kt +++ b/compiler/testData/codegen/box/casts/as.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + fun foo(x: Any) = x as Runnable fun box(): String { diff --git a/compiler/testData/codegen/box/casts/asSafe.kt b/compiler/testData/codegen/box/casts/asSafe.kt index a5ee61de932..94c62111e02 100644 --- a/compiler/testData/codegen/box/casts/asSafe.kt +++ b/compiler/testData/codegen/box/casts/asSafe.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + fun foo(x: Any) = x as? Runnable fun box(): String { diff --git a/compiler/testData/codegen/box/casts/is.kt b/compiler/testData/codegen/box/casts/is.kt index 30b0a2763a1..d10f77a86ef 100644 --- a/compiler/testData/codegen/box/casts/is.kt +++ b/compiler/testData/codegen/box/casts/is.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + fun foo(x: Any) = x is Runnable fun box(): String { diff --git a/compiler/testData/codegen/box/casts/notIs.kt b/compiler/testData/codegen/box/casts/notIs.kt index 3231c0e9743..262d2db9b5a 100644 --- a/compiler/testData/codegen/box/casts/notIs.kt +++ b/compiler/testData/codegen/box/casts/notIs.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + fun foo(x: Any) = x !is Runnable fun box(): String { diff --git a/compiler/testData/codegen/box/dataClasses/kt5002.kt b/compiler/testData/codegen/box/dataClasses/kt5002.kt index c67a3c2e32c..763ddc8909c 100644 --- a/compiler/testData/codegen/box/dataClasses/kt5002.kt +++ b/compiler/testData/codegen/box/dataClasses/kt5002.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + import java.io.Serializable public data class Pair ( diff --git a/compiler/testData/codegen/box/dataClasses/toString/arrayParams.kt b/compiler/testData/codegen/box/dataClasses/toString/arrayParams.kt index 8f68bfee5a9..c195530bf54 100644 --- a/compiler/testData/codegen/box/dataClasses/toString/arrayParams.kt +++ b/compiler/testData/codegen/box/dataClasses/toString/arrayParams.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + data class A(val x: Array?, val y: IntArray?) fun box(): String { diff --git a/compiler/testData/codegen/box/functions/kt1739.kt b/compiler/testData/codegen/box/functions/kt1739.kt index 29cbdb30f2a..ee3811c3548 100644 --- a/compiler/testData/codegen/box/functions/kt1739.kt +++ b/compiler/testData/codegen/box/functions/kt1739.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + public class RunnableFunctionWrapper(val f : () -> Unit) : Runnable { public override fun run() { f() diff --git a/compiler/testData/codegen/box/objects/kt1737.kt b/compiler/testData/codegen/box/objects/kt1737.kt index c5f7fb5dd4b..933f3aef48c 100644 --- a/compiler/testData/codegen/box/objects/kt1737.kt +++ b/compiler/testData/codegen/box/objects/kt1737.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + fun box(): String { return object { fun foo(): String { diff --git a/compiler/testData/codegen/box/objects/kt2663_2.kt b/compiler/testData/codegen/box/objects/kt2663_2.kt index ef7e9ea56f4..041a1970cb9 100644 --- a/compiler/testData/codegen/box/objects/kt2663_2.kt +++ b/compiler/testData/codegen/box/objects/kt2663_2.kt @@ -1,3 +1,6 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + fun box() : String { var a = 1 diff --git a/compiler/testData/codegen/box/sam/constructors/nonLiteralRunnable.kt b/compiler/testData/codegen/box/sam/constructors/nonLiteralRunnable.kt index 86b3923ef96..59818629db0 100644 --- a/compiler/testData/codegen/box/sam/constructors/nonLiteralRunnable.kt +++ b/compiler/testData/codegen/box/sam/constructors/nonLiteralRunnable.kt @@ -1,3 +1,5 @@ +// TARGET_BACKEND: JVM + fun box(): String { var result = "FAIL" val f = { result = "OK" } diff --git a/compiler/testData/codegen/box/sam/constructors/nonTrivialRunnable.kt b/compiler/testData/codegen/box/sam/constructors/nonTrivialRunnable.kt index 8735e110d6c..23dd339127c 100644 --- a/compiler/testData/codegen/box/sam/constructors/nonTrivialRunnable.kt +++ b/compiler/testData/codegen/box/sam/constructors/nonTrivialRunnable.kt @@ -1,3 +1,5 @@ +// TARGET_BACKEND: JVM + var result = "FAIL" fun getFun(): () -> Unit { diff --git a/compiler/testData/codegen/box/sam/constructors/runnable.kt b/compiler/testData/codegen/box/sam/constructors/runnable.kt index dd973440ff8..7c4564f0b50 100644 --- a/compiler/testData/codegen/box/sam/constructors/runnable.kt +++ b/compiler/testData/codegen/box/sam/constructors/runnable.kt @@ -1,3 +1,5 @@ +// TARGET_BACKEND: JVM + var result = "FAIL" fun box(): String { diff --git a/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure1.kt b/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure1.kt index 3b7c44991d7..1381931b9f1 100644 --- a/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure1.kt +++ b/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure1.kt @@ -1,3 +1,5 @@ +// TARGET_BACKEND: JVM + fun box(): String { val o = "O" var result = "" diff --git a/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt b/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt index a54080487d0..15c2ff185e9 100644 --- a/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt +++ b/compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt @@ -1,3 +1,5 @@ +// TARGET_BACKEND: JVM + class Box(val s: String) { fun extract(): String { var result = "" diff --git a/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt b/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt index 59b529e433b..70ad7f5b42b 100644 --- a/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt +++ b/compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt @@ -1,3 +1,5 @@ +// TARGET_BACKEND: JVM + var global = "" fun Runnable(f: () -> Unit) = object : Runnable { diff --git a/compiler/testData/codegen/box/traits/traitImplGenericDelegation.kt b/compiler/testData/codegen/box/traits/traitImplGenericDelegation.kt index 20d8120a12c..65253011fd9 100644 --- a/compiler/testData/codegen/box/traits/traitImplGenericDelegation.kt +++ b/compiler/testData/codegen/box/traits/traitImplGenericDelegation.kt @@ -12,6 +12,10 @@ class C : B { } } +interface Runnable { + fun run(): Unit +} + fun box(): String { val x = C().foo("", 0) return if (x == null) "OK" else "Fail: $x" diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 8c320ec9c11..f3d738aa2dc 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -2638,7 +2638,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("as.kt") public void testAs() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/casts/as.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("asForConstants.kt") @@ -2655,7 +2660,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("asSafe.kt") public void testAsSafe() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/casts/asSafe.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("asSafeFail.kt") @@ -2713,7 +2723,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("is.kt") public void testIs() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/casts/is.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("lambdaToUnitCast.kt") @@ -2725,7 +2740,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("notIs.kt") public void testNotIs() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/casts/notIs.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("unitAsAny.kt") @@ -6063,7 +6083,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("kt5002.kt") public void testKt5002() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/dataClasses/kt5002.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("mixedParams.kt") @@ -6346,7 +6371,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("arrayParams.kt") public void testArrayParams() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/dataClasses/toString/arrayParams.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("changingVarParam.kt") @@ -8818,7 +8848,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("kt1739.kt") public void testKt1739() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/kt1739.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("kt2270.kt") @@ -12104,7 +12139,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("kt1737.kt") public void testKt1737() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/kt1737.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("kt2398.kt") @@ -12122,7 +12162,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("kt2663_2.kt") public void testKt2663_2() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/kt2663_2.kt"); - doTest(fileName); + try { + doTest(fileName); + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + catch (Throwable ignore) { + } } @TestMetadata("kt2675.kt") @@ -19061,36 +19106,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } - @TestMetadata("nonLiteralRunnable.kt") - public void testNonLiteralRunnable() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/nonLiteralRunnable.kt"); - doTest(fileName); - } - - @TestMetadata("nonTrivialRunnable.kt") - public void testNonTrivialRunnable() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/nonTrivialRunnable.kt"); - doTest(fileName); - } - - @TestMetadata("runnable.kt") - public void testRunnable() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/runnable.kt"); - doTest(fileName); - } - - @TestMetadata("runnableAccessingClosure1.kt") - public void testRunnableAccessingClosure1() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure1.kt"); - doTest(fileName); - } - - @TestMetadata("runnableAccessingClosure2.kt") - public void testRunnableAccessingClosure2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/runnableAccessingClosure2.kt"); - doTest(fileName); - } - @TestMetadata("samWrappersDifferentFiles.kt") public void testSamWrappersDifferentFiles() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/samWrappersDifferentFiles.kt"); @@ -19113,11 +19128,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } - @TestMetadata("syntheticVsReal.kt") - public void testSyntheticVsReal() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/sam/constructors/syntheticVsReal.kt"); - doTest(fileName); - } } }