From b49ec3edb8fa835b7096d2f6164fe5b5ebcfb12e Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Sun, 27 Jan 2019 02:47:42 +0300 Subject: [PATCH] Disable generation of 1.2 coroutine tests for JS_IR Add directive DONT_TARGET_EXACT_BACKEND. This directive is needed to exclude JS_IR backned but keep "compatible" JS backend. --- .../coroutines/asyncIteratorNullMerge_1_2.kt | 3 +- .../box/coroutines/asyncIteratorToList_1_2.kt | 3 +- .../box/coroutines/asyncIterator_1_2.kt | 3 +- .../box/coroutines/controlFlow/kt22694_1_2.kt | 2 +- .../createCoroutinesOnManualInstances_1_2.kt | 2 +- .../box/coroutines/reflect/isSuspend12.kt | 2 +- .../ifExpressionInsideCoroutine_1_2.kt | 2 +- ...ddleOfObjectConstructionEvaluationOrder.kt | 1 + .../kotlin/test/InTextDirectivesUtils.java | 4 +++ .../IrJsCodegenBoxTestGenerated.java | 35 ------------------- 10 files changed, 15 insertions(+), 42 deletions(-) diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt index 5d0c9ba4c34..cbeed9693ab 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt @@ -1,7 +1,8 @@ // !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// IGNORE_BACKEND: JVM_IR, JS_IR +// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES +// DONT_TARGET_EXACT_BACKEND: JS_IR import helpers.* import kotlin.coroutines.experimental.* diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt index 9e3e774a5bb..f05f832832e 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt @@ -1,7 +1,8 @@ // !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// IGNORE_BACKEND: JVM_IR, JS_IR +// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES +// DONT_TARGET_EXACT_BACKEND: JS_IR import helpers.* import kotlin.coroutines.experimental.* diff --git a/compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt b/compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt index 64a0cc68858..aaca26ba251 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt @@ -1,7 +1,8 @@ // !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// IGNORE_BACKEND: JVM_IR, JS_IR +// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES +// DONT_TARGET_EXACT_BACKEND: JS_IR import helpers.* import kotlin.coroutines.experimental.* diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt b/compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt index 162cd02369c..cf80e84651f 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt @@ -1,8 +1,8 @@ // !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES +// DONT_TARGET_EXACT_BACKEND: JS_IR import helpers.* import kotlin.coroutines.experimental.* diff --git a/compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances_1_2.kt b/compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances_1_2.kt index 7334f3dd334..b58175a27c2 100644 --- a/compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances_1_2.kt @@ -1,7 +1,7 @@ // !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME // WITH_COROUTINES +// DONT_TARGET_EXACT_BACKEND: JS_IR // IGNORE_BACKEND: JS import kotlin.coroutines.experimental.* diff --git a/compiler/testData/codegen/box/coroutines/reflect/isSuspend12.kt b/compiler/testData/codegen/box/coroutines/reflect/isSuspend12.kt index 78ab5dc229d..4376d39c1ac 100644 --- a/compiler/testData/codegen/box/coroutines/reflect/isSuspend12.kt +++ b/compiler/testData/codegen/box/coroutines/reflect/isSuspend12.kt @@ -1,9 +1,9 @@ // !LANGUAGE: -ReleaseCoroutines // WITH_COROUTINES // WITH_REFLECT +// DONT_TARGET_EXACT_BACKEND: JS_IR // IGNORE_BACKEND: NATIVE -// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS import helpers.* diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt index f998ac98aa3..3542f346c32 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt @@ -1,8 +1,8 @@ // !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES +// DONT_TARGET_EXACT_BACKEND: JS_IR import helpers.* import kotlin.coroutines.experimental.* diff --git a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt index b5f78c55506..fdea2dbc740 100644 --- a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt +++ b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt @@ -4,6 +4,7 @@ // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST +// KJS_WITH_FULL_RUNTIME import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java b/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java index 82ce06337a7..d599d702547 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java @@ -221,6 +221,10 @@ public final class InTextDirectivesUtils { public static boolean isCompatibleTarget(TargetBackend targetBackend, File file) { if (targetBackend == TargetBackend.ANY) return true; + List doNotTarget = findLinesWithPrefixesRemoved(textWithDirectives(file), "// DONT_TARGET_EXACT_BACKEND: "); + if (doNotTarget.contains(targetBackend.name())) + return false; + List backends = findLinesWithPrefixesRemoved(textWithDirectives(file), "// TARGET_BACKEND: "); return backends.isEmpty() || backends.contains(targetBackend.name()) || backends.contains(targetBackend.getCompatibleWith().name()); } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index 716d7b28fac..363e6bd3de3 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -4669,31 +4669,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } - @TestMetadata("asyncIteratorNullMerge_1_2.kt") - public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt"); - } - @TestMetadata("asyncIteratorNullMerge_1_3.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt"); } - @TestMetadata("asyncIteratorToList_1_2.kt") - public void testAsyncIteratorToList_1_2() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt"); - } - @TestMetadata("asyncIteratorToList_1_3.kt") public void testAsyncIteratorToList_1_3() throws Exception { runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt"); } - @TestMetadata("asyncIterator_1_2.kt") - public void testAsyncIterator_1_2() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt"); - } - @TestMetadata("asyncIterator_1_3.kt") public void testAsyncIterator_1_3() throws Exception { runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt"); @@ -4749,11 +4734,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); } - @TestMetadata("createCoroutinesOnManualInstances_1_2.kt") - public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances_1_2.kt"); - } - @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines"); @@ -5192,11 +5172,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines"); } - @TestMetadata("kt22694_1_2.kt") - public void testKt22694_1_2() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt"); - } - @TestMetadata("kt22694_1_3.kt") public void testKt22694_1_3() throws Exception { runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_3.kt"); @@ -5873,11 +5848,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testAllFilesPresentInReflect() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } - - @TestMetadata("isSuspend12.kt") - public void testIsSuspend12() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/reflect/isSuspend12.kt"); - } } @TestMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding") @@ -5953,11 +5923,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines"); } - @TestMetadata("ifExpressionInsideCoroutine_1_2.kt") - public void testIfExpressionInsideCoroutine_1_2() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt"); - } - @TestMetadata("ifExpressionInsideCoroutine_1_3.kt") public void testIfExpressionInsideCoroutine_1_3() throws Exception { runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_3.kt");