From d0b0fdd7323d9fc0476874c3527584cf10628f07 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 31 May 2017 16:19:34 +0300 Subject: [PATCH] Ignore lateinit local vars tests in JS and Native --- .../uninitializedCapturedMemberAccess.kt | 2 ++ .../local/uninitializedCapturedRead.kt | 2 ++ .../local/uninitializedMemberAccess.kt | 2 ++ .../lateinit/local/uninitializedRead.kt | 2 ++ .../semantics/JsCodegenBoxTestGenerated.java | 32 ++++++++++++++++--- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt index 2e08b944580..485ec0bd1bf 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt @@ -1,4 +1,6 @@ // WITH_REFLECT +// IGNORE_BACKEND: JS, NATIVE + import kotlin.UninitializedPropertyAccessException fun runNoInline(f: () -> Unit) = f() diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt index 988041310cf..96bed50b39d 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt @@ -1,4 +1,6 @@ // WITH_REFLECT +// IGNORE_BACKEND: JS, NATIVE + import kotlin.UninitializedPropertyAccessException fun runNoInline(f: () -> Unit) = f() diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt index dbb026ff2ea..fcd700bcd54 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt @@ -1,4 +1,6 @@ // WITH_REFLECT +// IGNORE_BACKEND: JS, NATIVE + import kotlin.UninitializedPropertyAccessException fun box(): String { diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt index 1e2d1b41604..46cfd707616 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt @@ -1,4 +1,6 @@ // WITH_REFLECT +// IGNORE_BACKEND: JS, NATIVE + import kotlin.UninitializedPropertyAccessException fun box(): String { 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 49403625a96..e4f77c7acbe 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 @@ -15024,25 +15024,49 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("uninitializedCapturedMemberAccess.kt") public void testUninitializedCapturedMemberAccess() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt"); - doTest(fileName); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } @TestMetadata("uninitializedCapturedRead.kt") public void testUninitializedCapturedRead() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt"); - doTest(fileName); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } @TestMetadata("uninitializedMemberAccess.kt") public void testUninitializedMemberAccess() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt"); - doTest(fileName); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } @TestMetadata("uninitializedRead.kt") public void testUninitializedRead() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt"); - doTest(fileName); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } } }