From c887b88ed9efb0d61516712f209553d0b150b0b8 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Fri, 15 Jun 2018 20:16:50 +0300 Subject: [PATCH] Fix coroutine test generator --- .../ir/IrBlackBoxCodegenTestGenerated.java | 1284 +++++------- .../IrBlackBoxInlineCodegenTestGenerated.java | 232 +-- ...otlinAgainstInlineKotlinTestGenerated.java | 232 +-- ...BlackBoxWithJava8CodegenTestGenerated.java | 16 +- .../DiagnosticsTestWithStdLibGenerated.java | 214 +- ...ticsTestWithStdLibUsingJavacGenerated.java | 214 +- .../codegen/BlackBoxCodegenTestGenerated.java | 1284 +++++------- .../BlackBoxInlineCodegenTestGenerated.java | 232 +-- .../codegen/BytecodeListingTestGenerated.java | 56 +- .../codegen/BytecodeTextTestGenerated.java | 92 +- ...otlinAgainstInlineKotlinTestGenerated.java | 232 +-- ...mpileKotlinAgainstKotlinTestGenerated.java | 10 +- .../LightAnalysisModeTestGenerated.java | 1284 +++++------- ...unTestMethodWithPackageReplacementModel.kt | 31 + .../tests/generator/SimpleTestClassModel.java | 14 +- .../kotlin/generators/util/coroutines.kt | 26 +- .../IrJsCodegenBoxTestGenerated.java | 1827 +++-------------- .../semantics/JsCodegenBoxTestGenerated.java | 699 +++---- 18 files changed, 2597 insertions(+), 5382 deletions(-) create mode 100644 generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/RunTestMethodWithPackageReplacementModel.kt diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index bef7361c6e0..2cabe92cc4a 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -735,6 +735,10 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInJvm() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/assert/jvm"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @@ -791,50 +795,42 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines"); } } } @@ -3832,6 +3828,10 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/closures/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @@ -3883,14 +3883,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines"); } } @@ -5203,28 +5201,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines"); } public void testAllFilesPresentInCoroutines() throws Exception { @@ -5233,962 +5231,802 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); } @TestMetadata("await.kt") public void testAwait_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines.experimental"); } @TestMetadata("await.kt") public void testAwait_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines"); } @TestMetadata("coroutineToString.kt") public void testCoroutineToString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineToString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineToString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineToString.kt") public void testCoroutineToString_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineToString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineToString.kt", "kotlin.coroutines"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines.experimental"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines"); } @TestMetadata("generate.kt") public void testGenerate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("generate.kt") public void testGenerate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines"); } @TestMetadata("illegalState.kt") public void testIllegalState_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/illegalState.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/illegalState.kt", "kotlin.coroutines.experimental"); } @TestMetadata("illegalState.kt") public void testIllegalState_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/illegalState.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/illegalState.kt", "kotlin.coroutines"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines"); } @TestMetadata("kt12958.kt") public void testKt12958_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt12958.kt") public void testKt12958_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines"); } @TestMetadata("kt15016.kt") public void testKt15016_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15016.kt") public void testKt15016_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines"); } @TestMetadata("kt15017.kt") public void testKt15017_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15017.kt") public void testKt15017_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines"); } @TestMetadata("kt15930.kt") public void testKt15930_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15930.kt") public void testKt15930_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines"); } @TestMetadata("kt21605.kt") public void testKt21605_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt21605.kt") public void testKt21605_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines.experimental"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("suspendCovariantJavaOverrides.kt") public void testSuspendCovariantJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCovariantJavaOverrides.kt") public void testSuspendCovariantJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/controlFlow") @@ -6199,164 +6037,142 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInControlFlow() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines"); } @TestMetadata("forContinue.kt") public void testForContinue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forContinue.kt") public void testForContinue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines"); } @TestMetadata("forStatement.kt") public void testForStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forStatement.kt") public void testForStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines"); } } @@ -6368,116 +6184,102 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInFeatureIntersection() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines"); } @TestMetadata("delegate.kt") public void testDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegate.kt") public void testDelegate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @@ -6488,164 +6290,142 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInTailrec() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines"); } @TestMetadata("extention.kt") public void testExtention_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extention.kt") public void testExtention_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("sum.kt") public void testSum_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sum.kt") public void testSum_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines"); } } } @@ -6658,128 +6438,112 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines"); } } @@ -6791,104 +6555,92 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInIntrinsicSemantics() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intrinsicSemantics"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines.experimental"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines"); } } @@ -6930,128 +6682,112 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInNamed() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/localFunctions/named"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("extension.kt") public void testExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extension.kt") public void testExtension_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines"); } @TestMetadata("infix.kt") public void testInfix_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infix.kt") public void testInfix_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines"); } } } @@ -7064,104 +6800,92 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInMultiModule() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines"); } } @@ -7173,20 +6897,22 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInRedundantLocalsElimination() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/redundantLocalsElimination"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines"); } } @@ -7198,56 +6924,52 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInStackUnwinding() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/stackUnwinding"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("exception.kt") public void testException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("exception.kt") public void testException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines"); } } @@ -7259,212 +6981,182 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("inline.kt") public void testInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inline.kt") public void testInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines"); } @TestMetadata("member.kt") public void testMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines.experimental"); } @TestMetadata("member.kt") public void testMember_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("openFunWithJava.kt") public void testOpenFunWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("openFunWithJava.kt") public void testOpenFunWithJava_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt", "kotlin.coroutines"); } @TestMetadata("operators.kt") public void testOperators_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines.experimental"); } @TestMetadata("operators.kt") public void testOperators_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines"); } @TestMetadata("superCall.kt") public void testSuperCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCall.kt") public void testSuperCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines"); } } @@ -7476,56 +7168,52 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionTypeCall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("localVal.kt") public void testLocalVal_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localVal.kt") public void testLocalVal_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines"); } } @@ -7537,92 +7225,82 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInTailCallOptimizations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("crossinline.kt") public void testCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinline.kt") public void testCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines"); } } @@ -7634,56 +7312,52 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInTailOperations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailOperations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines"); } } @@ -7695,68 +7369,62 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInUnitTypeReturn() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/unitTypeReturn"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines"); } } @@ -7768,32 +7436,32 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("kt19475.kt") public void testKt19475_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt19475.kt") public void testKt19475_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index b3ec21594ee..8dc610cf771 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -3201,188 +3201,162 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInSuspend() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @@ -3393,32 +3367,32 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInDefaultParameter() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines"); } } @@ -3453,104 +3427,92 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInReceiver() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/receiver"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } } @@ -3562,140 +3524,122 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInStateMachine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/stateMachine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 522e65545a3..de0245fd41f 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3201,188 +3201,162 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInSuspend() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @@ -3393,32 +3367,32 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInDefaultParameter() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines"); } } @@ -3453,104 +3427,92 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInReceiver() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/receiver"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } } @@ -3562,140 +3524,122 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + public void testAllFilesPresentInStateMachine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/stateMachine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java index 953255225b2..78dd5f23b15 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java @@ -25,32 +25,32 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInBox() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/java8/box"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("asyncException.kt") public void testAsyncException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/asyncException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/java8/box/asyncException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncException.kt") public void testAsyncException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/asyncException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/java8/box/asyncException.kt", "kotlin.coroutines"); } @TestMetadata("async.kt") public void testAsync_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/async.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/java8/box/async.kt", "kotlin.coroutines.experimental"); } @TestMetadata("async.kt") public void testAsync_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/async.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/java8/box/async.kt", "kotlin.coroutines"); } @TestMetadata("capturedSuperCall.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index 1bc0723f03b..2d610243717 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -1355,6 +1355,10 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInCoroutines() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @@ -1396,14 +1400,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("kt18292.kt") public void testKt18292_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt18292.kt") public void testKt18292_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines"); } @TestMetadata("lambdaExpectedType.kt") @@ -1428,14 +1430,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("noDefaultCoroutineImports.kt") public void testNoDefaultCoroutineImports_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noDefaultCoroutineImports.kt") public void testNoDefaultCoroutineImports_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalSuspension.kt") @@ -1465,14 +1465,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("suspendApplicability.kt") public void testSuspendApplicability_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendApplicability.kt") public void testSuspendApplicability_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt", "kotlin.coroutines"); } @TestMetadata("suspendConflictsWithNoSuspend.kt") @@ -1482,14 +1480,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("suspendCoroutineOrReturn.kt") public void testSuspendCoroutineOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineOrReturn.kt") public void testSuspendCoroutineOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineUnavailableWithNewAPI.kt") @@ -1504,14 +1500,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("suspendCovarianJavaOverride.kt") public void testSuspendCovarianJavaOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCovarianJavaOverride.kt") public void testSuspendCovarianJavaOverride_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt", "kotlin.coroutines"); } @TestMetadata("suspendDestructuring.kt") @@ -1526,50 +1520,42 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("suspendFunctions.kt") public void testSuspendFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctions.kt") public void testSuspendFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaImplementationFromDifferentClass.kt") public void testSuspendJavaImplementationFromDifferentClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaImplementationFromDifferentClass.kt") public void testSuspendJavaImplementationFromDifferentClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambda.kt") public void testSuspendLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambda.kt") public void testSuspendLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendOverridability.kt") @@ -1698,152 +1684,132 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInInlineCrossinline() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("inlineOrdinaryOfCrossinlineOrdinary.kt") public void testInlineOrdinaryOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineOrdinary.kt") public void testInlineOrdinaryOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineOrdinary.kt") public void testInlineOrdinaryOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineOrdinary.kt") public void testInlineOrdinaryOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfOrdinary.kt") public void testInlineOrdinaryOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfOrdinary.kt") public void testInlineOrdinaryOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfSuspend.kt") public void testInlineOrdinaryOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfSuspend.kt") public void testInlineOrdinaryOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } } @@ -1855,104 +1821,92 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInRestrictSuspension() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("allMembersAllowed.kt") public void testAllMembersAllowed_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt", "kotlin.coroutines.experimental"); } @TestMetadata("allMembersAllowed.kt") public void testAllMembersAllowed_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt", "kotlin.coroutines"); } @TestMetadata("extensions.kt") public void testExtensions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extensions.kt") public void testExtensions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt", "kotlin.coroutines"); } @TestMetadata("memberExtension.kt") public void testMemberExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("memberExtension.kt") public void testMemberExtension_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt", "kotlin.coroutines"); } @TestMetadata("notRelatedFun.kt") public void testNotRelatedFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("notRelatedFun.kt") public void testNotRelatedFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt", "kotlin.coroutines"); } @TestMetadata("outerYield.kt") public void testOuterYield_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt", "kotlin.coroutines.experimental"); } @TestMetadata("outerYield.kt") public void testOuterYield_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt", "kotlin.coroutines"); } @TestMetadata("sameInstance.kt") public void testSameInstance_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameInstance.kt") public void testSameInstance_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt", "kotlin.coroutines"); } @TestMetadata("simpleForbidden.kt") public void testSimpleForbidden_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleForbidden.kt") public void testSimpleForbidden_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt", "kotlin.coroutines"); } @TestMetadata("wrongEnclosingFunction.kt") public void testWrongEnclosingFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("wrongEnclosingFunction.kt") public void testWrongEnclosingFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt", "kotlin.coroutines"); } } @@ -2047,20 +2001,22 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInTailCalls() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("forbidden.kt") public void testForbidden_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forbidden.kt") public void testForbidden_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt", "kotlin.coroutines"); } @TestMetadata("localFunctions.kt") @@ -2070,14 +2026,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("nothingTypedSuspendFunction.kt") public void testNothingTypedSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nothingTypedSuspendFunction.kt") public void testNothingTypedSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("recursive.kt") @@ -2087,26 +2041,22 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt", "kotlin.coroutines"); } @TestMetadata("valid.kt") public void testValid_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt", "kotlin.coroutines.experimental"); } @TestMetadata("valid.kt") public void testValid_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java index 3eba860e4ad..d4704c46487 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -1355,6 +1355,10 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInCoroutines() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @@ -1396,14 +1400,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("kt18292.kt") public void testKt18292_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt18292.kt") public void testKt18292_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines"); } @TestMetadata("lambdaExpectedType.kt") @@ -1428,14 +1430,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("noDefaultCoroutineImports.kt") public void testNoDefaultCoroutineImports_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noDefaultCoroutineImports.kt") public void testNoDefaultCoroutineImports_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/noDefaultCoroutineImports.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalSuspension.kt") @@ -1465,14 +1465,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("suspendApplicability.kt") public void testSuspendApplicability_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendApplicability.kt") public void testSuspendApplicability_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendApplicability.kt", "kotlin.coroutines"); } @TestMetadata("suspendConflictsWithNoSuspend.kt") @@ -1482,14 +1480,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("suspendCoroutineOrReturn.kt") public void testSuspendCoroutineOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineOrReturn.kt") public void testSuspendCoroutineOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineUnavailableWithNewAPI.kt") @@ -1504,14 +1500,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("suspendCovarianJavaOverride.kt") public void testSuspendCovarianJavaOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCovarianJavaOverride.kt") public void testSuspendCovarianJavaOverride_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt", "kotlin.coroutines"); } @TestMetadata("suspendDestructuring.kt") @@ -1526,50 +1520,42 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("suspendFunctions.kt") public void testSuspendFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctions.kt") public void testSuspendFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaImplementationFromDifferentClass.kt") public void testSuspendJavaImplementationFromDifferentClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaImplementationFromDifferentClass.kt") public void testSuspendJavaImplementationFromDifferentClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambda.kt") public void testSuspendLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambda.kt") public void testSuspendLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendOverridability.kt") @@ -1698,152 +1684,132 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInInlineCrossinline() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("inlineOrdinaryOfCrossinlineOrdinary.kt") public void testInlineOrdinaryOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineOrdinary.kt") public void testInlineOrdinaryOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineOrdinary.kt") public void testInlineOrdinaryOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineOrdinary.kt") public void testInlineOrdinaryOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfOrdinary.kt") public void testInlineOrdinaryOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfOrdinary.kt") public void testInlineOrdinaryOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfSuspend.kt") public void testInlineOrdinaryOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfSuspend.kt") public void testInlineOrdinaryOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineOrdinaryOfSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } } @@ -1855,104 +1821,92 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInRestrictSuspension() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("allMembersAllowed.kt") public void testAllMembersAllowed_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt", "kotlin.coroutines.experimental"); } @TestMetadata("allMembersAllowed.kt") public void testAllMembersAllowed_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/allMembersAllowed.kt", "kotlin.coroutines"); } @TestMetadata("extensions.kt") public void testExtensions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extensions.kt") public void testExtensions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/extensions.kt", "kotlin.coroutines"); } @TestMetadata("memberExtension.kt") public void testMemberExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("memberExtension.kt") public void testMemberExtension_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/memberExtension.kt", "kotlin.coroutines"); } @TestMetadata("notRelatedFun.kt") public void testNotRelatedFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("notRelatedFun.kt") public void testNotRelatedFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt", "kotlin.coroutines"); } @TestMetadata("outerYield.kt") public void testOuterYield_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt", "kotlin.coroutines.experimental"); } @TestMetadata("outerYield.kt") public void testOuterYield_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield.kt", "kotlin.coroutines"); } @TestMetadata("sameInstance.kt") public void testSameInstance_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameInstance.kt") public void testSameInstance_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/sameInstance.kt", "kotlin.coroutines"); } @TestMetadata("simpleForbidden.kt") public void testSimpleForbidden_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleForbidden.kt") public void testSimpleForbidden_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/simpleForbidden.kt", "kotlin.coroutines"); } @TestMetadata("wrongEnclosingFunction.kt") public void testWrongEnclosingFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("wrongEnclosingFunction.kt") public void testWrongEnclosingFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/wrongEnclosingFunction.kt", "kotlin.coroutines"); } } @@ -2047,20 +2001,22 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInTailCalls() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("forbidden.kt") public void testForbidden_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forbidden.kt") public void testForbidden_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt", "kotlin.coroutines"); } @TestMetadata("localFunctions.kt") @@ -2070,14 +2026,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("nothingTypedSuspendFunction.kt") public void testNothingTypedSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nothingTypedSuspendFunction.kt") public void testNothingTypedSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("recursive.kt") @@ -2087,26 +2041,22 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt", "kotlin.coroutines"); } @TestMetadata("valid.kt") public void testValid_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt", "kotlin.coroutines.experimental"); } @TestMetadata("valid.kt") public void testValid_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 79d461c738e..3850d1738d2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -735,6 +735,10 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInJvm() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/assert/jvm"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @@ -791,50 +795,42 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines"); } } } @@ -3832,6 +3828,10 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/closures/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @@ -3883,14 +3883,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines"); } } @@ -5203,28 +5201,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines"); } public void testAllFilesPresentInCoroutines() throws Exception { @@ -5233,962 +5231,802 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); } @TestMetadata("await.kt") public void testAwait_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines.experimental"); } @TestMetadata("await.kt") public void testAwait_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines"); } @TestMetadata("coroutineToString.kt") public void testCoroutineToString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineToString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineToString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineToString.kt") public void testCoroutineToString_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineToString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineToString.kt", "kotlin.coroutines"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines.experimental"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines"); } @TestMetadata("generate.kt") public void testGenerate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("generate.kt") public void testGenerate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines"); } @TestMetadata("illegalState.kt") public void testIllegalState_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/illegalState.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/illegalState.kt", "kotlin.coroutines.experimental"); } @TestMetadata("illegalState.kt") public void testIllegalState_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/illegalState.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/illegalState.kt", "kotlin.coroutines"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines"); } @TestMetadata("kt12958.kt") public void testKt12958_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt12958.kt") public void testKt12958_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines"); } @TestMetadata("kt15016.kt") public void testKt15016_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15016.kt") public void testKt15016_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines"); } @TestMetadata("kt15017.kt") public void testKt15017_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15017.kt") public void testKt15017_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines"); } @TestMetadata("kt15930.kt") public void testKt15930_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15930.kt") public void testKt15930_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines"); } @TestMetadata("kt21605.kt") public void testKt21605_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt21605.kt") public void testKt21605_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines.experimental"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("suspendCovariantJavaOverrides.kt") public void testSuspendCovariantJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCovariantJavaOverrides.kt") public void testSuspendCovariantJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/controlFlow") @@ -6199,164 +6037,142 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInControlFlow() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines"); } @TestMetadata("forContinue.kt") public void testForContinue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forContinue.kt") public void testForContinue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines"); } @TestMetadata("forStatement.kt") public void testForStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forStatement.kt") public void testForStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines"); } } @@ -6368,116 +6184,102 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInFeatureIntersection() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines"); } @TestMetadata("delegate.kt") public void testDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegate.kt") public void testDelegate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @@ -6488,164 +6290,142 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInTailrec() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines"); } @TestMetadata("extention.kt") public void testExtention_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extention.kt") public void testExtention_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("sum.kt") public void testSum_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sum.kt") public void testSum_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines"); } } } @@ -6658,128 +6438,112 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines"); } } @@ -6791,104 +6555,92 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInIntrinsicSemantics() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intrinsicSemantics"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines.experimental"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines"); } } @@ -6930,128 +6682,112 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInNamed() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/localFunctions/named"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("extension.kt") public void testExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extension.kt") public void testExtension_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines"); } @TestMetadata("infix.kt") public void testInfix_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infix.kt") public void testInfix_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines"); } } } @@ -7064,104 +6800,92 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInMultiModule() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines"); } } @@ -7173,20 +6897,22 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInRedundantLocalsElimination() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/redundantLocalsElimination"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines"); } } @@ -7198,56 +6924,52 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInStackUnwinding() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/stackUnwinding"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("exception.kt") public void testException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("exception.kt") public void testException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines"); } } @@ -7259,212 +6981,182 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("inline.kt") public void testInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inline.kt") public void testInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines"); } @TestMetadata("member.kt") public void testMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines.experimental"); } @TestMetadata("member.kt") public void testMember_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("openFunWithJava.kt") public void testOpenFunWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("openFunWithJava.kt") public void testOpenFunWithJava_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt", "kotlin.coroutines"); } @TestMetadata("operators.kt") public void testOperators_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines.experimental"); } @TestMetadata("operators.kt") public void testOperators_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines"); } @TestMetadata("superCall.kt") public void testSuperCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCall.kt") public void testSuperCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines"); } } @@ -7476,56 +7168,52 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionTypeCall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("localVal.kt") public void testLocalVal_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localVal.kt") public void testLocalVal_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines"); } } @@ -7537,92 +7225,82 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInTailCallOptimizations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("crossinline.kt") public void testCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinline.kt") public void testCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines"); } } @@ -7634,56 +7312,52 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInTailOperations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailOperations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines"); } } @@ -7695,68 +7369,62 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInUnitTypeReturn() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/unitTypeReturn"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines"); } } @@ -7768,32 +7436,32 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("kt19475.kt") public void testKt19475_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt19475.kt") public void testKt19475_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 92739631958..0b921eceef5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -3201,188 +3201,162 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInSuspend() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @@ -3393,32 +3367,32 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInDefaultParameter() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines"); } } @@ -3453,104 +3427,92 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInReceiver() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/receiver"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } } @@ -3562,140 +3524,122 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInStateMachine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/stateMachine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index 5d0144ed8c1..54116a9c103 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -25,6 +25,10 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInBytecodeListing() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @@ -36,26 +40,22 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { @TestMetadata("coroutineContextIntrinsic.kt") public void testCoroutineContextIntrinsic_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextIntrinsic.kt") public void testCoroutineContextIntrinsic_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt", "kotlin.coroutines"); } @TestMetadata("coroutineFields.kt") public void testCoroutineFields_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/coroutineFields.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/coroutineFields.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineFields.kt") public void testCoroutineFields_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/coroutineFields.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/coroutineFields.kt", "kotlin.coroutines"); } @TestMetadata("defaultImpls.kt") @@ -140,14 +140,12 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { @TestMetadata("oomInReturnUnit.kt") public void testOomInReturnUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/oomInReturnUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/oomInReturnUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("oomInReturnUnit.kt") public void testOomInReturnUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/oomInReturnUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/oomInReturnUnit.kt", "kotlin.coroutines"); } @TestMetadata("privateSuspendFun.kt") @@ -167,14 +165,12 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { @TestMetadata("suspendReifiedFun.kt") public void testSuspendReifiedFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendReifiedFun.kt") public void testSuspendReifiedFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/bytecodeListing/annotations") @@ -391,56 +387,52 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInTailcall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/tailcall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("tailCallIntrinsics.kt") public void testTailCallIntrinsics_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallIntrinsics.kt") public void testTailCallIntrinsics_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt", "kotlin.coroutines"); } @TestMetadata("tailSuspendUnitFun.kt") public void testTailSuspendUnitFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/tailSuspendUnitFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailSuspendUnitFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailSuspendUnitFun.kt") public void testTailSuspendUnitFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/tailSuspendUnitFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailSuspendUnitFun.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchTailCall.kt") public void testTryCatchTailCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/tryCatchTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tryCatchTailCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchTailCall.kt") public void testTryCatchTailCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/tryCatchTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tryCatchTailCall.kt", "kotlin.coroutines"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/unreachable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/tailcall/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/unreachable.kt", "kotlin.coroutines"); } @TestMetadata("whenUnit.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index f877acd3e18..913283db80c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -1044,56 +1044,52 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInCoroutines() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("doNotReassignContinuation.kt") public void testDoNotReassignContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("doNotReassignContinuation.kt") public void testDoNotReassignContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt", "kotlin.coroutines"); } @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda") @@ -1122,128 +1118,112 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index d93d5f2374e..0258a8b441c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3201,188 +3201,162 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInSuspend() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt") public void testCrossinlineSuspendLambdaInsideCrossinlineSuspendLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/crossinlineSuspendLambdaInsideCrossinlineSuspendLambda.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendContinuation.kt") public void testInlineSuspendContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendContinuation.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleLocals.kt") public void testMultipleLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleLocals.kt", "kotlin.coroutines"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleSuspensionPoints.kt") public void testMultipleSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/multipleSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnValue.kt") public void testReturnValue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/returnValue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchStackTransform.kt") public void testTryCatchStackTransform_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @@ -3393,32 +3367,32 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInDefaultParameter() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueCrossinline.kt") public void testDefaultValueCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultValueInline.kt") public void testDefaultValueInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines"); } } @@ -3453,104 +3427,92 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInReceiver() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/receiver"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfCrossinlineSuspend.kt") public void testInlineOrdinaryOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineOrdinaryOfNoinlineSuspend.kt") public void testInlineOrdinaryOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineOrdinaryOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt") public void testInlineSuspendOfCrossinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfCrossinlineSuspend.kt") public void testInlineSuspendOfCrossinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfCrossinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineOrdinary.kt") public void testInlineSuspendOfNoinlineOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfNoinlineSuspend.kt") public void testInlineSuspendOfNoinlineSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfNoinlineSuspend.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfOrdinary.kt") public void testInlineSuspendOfOrdinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfOrdinary.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendOfSuspend.kt") public void testInlineSuspendOfSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/receiver/inlineSuspendOfSuspend.kt", "kotlin.coroutines"); } } @@ -3562,140 +3524,122 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInStateMachine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/stateMachine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaInsideLambda.kt") public void testInnerLambdaInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambdaWithoutCrossinline.kt") public void testInnerLambdaWithoutCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerLambda.kt") public void testInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt", "kotlin.coroutines"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadnessCallSite.kt") public void testInnerMadnessCallSite_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt", "kotlin.coroutines"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerMadness.kt") public void testInnerMadness_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectInsideInnerObject.kt") public void testInnerObjectInsideInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectSeveralFunctions.kt") public void testInnerObjectSeveralFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectSeveralFunctions.kt", "kotlin.coroutines"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObjectWithoutCapturingCrossinline.kt") public void testInnerObjectWithoutCapturingCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt", "kotlin.coroutines"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerObject.kt") public void testInnerObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt", "kotlin.coroutines"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("normalInline.kt") public void testNormalInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt", "kotlin.coroutines"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("numberOfSuspentions.kt") public void testNumberOfSuspentions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt", "kotlin.coroutines"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index 23a397f8523..b4edb00c034 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -25,6 +25,10 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); + } + public void testAllFilesPresentInCompileKotlinAgainstKotlin() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @@ -86,14 +90,12 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl @TestMetadata("coroutinesBinary.kt") public void testCoroutinesBinary_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutinesBinary.kt") public void testCoroutinesBinary_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt", "kotlin.coroutines"); } @TestMetadata("defaultConstructor.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 058b07957a7..ccd9732193a 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -735,6 +735,10 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInJvm() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/assert/jvm"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @@ -791,50 +795,42 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines"); } } } @@ -3832,6 +3828,10 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/closures/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @@ -3883,14 +3883,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines"); } } @@ -5203,28 +5201,28 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines"); } public void testAllFilesPresentInCoroutines() throws Exception { @@ -5233,962 +5231,802 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); } @TestMetadata("await.kt") public void testAwait_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines.experimental"); } @TestMetadata("await.kt") public void testAwait_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines"); } @TestMetadata("coroutineToString.kt") public void testCoroutineToString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineToString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineToString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineToString.kt") public void testCoroutineToString_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineToString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineToString.kt", "kotlin.coroutines"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines.experimental"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines"); } @TestMetadata("generate.kt") public void testGenerate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("generate.kt") public void testGenerate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines"); } @TestMetadata("illegalState.kt") public void testIllegalState_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/illegalState.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/illegalState.kt", "kotlin.coroutines.experimental"); } @TestMetadata("illegalState.kt") public void testIllegalState_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/illegalState.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/illegalState.kt", "kotlin.coroutines"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines"); } @TestMetadata("kt12958.kt") public void testKt12958_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt12958.kt") public void testKt12958_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines"); } @TestMetadata("kt15016.kt") public void testKt15016_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15016.kt") public void testKt15016_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines"); } @TestMetadata("kt15017.kt") public void testKt15017_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15017.kt") public void testKt15017_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines"); } @TestMetadata("kt15930.kt") public void testKt15930_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15930.kt") public void testKt15930_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines"); } @TestMetadata("kt21605.kt") public void testKt21605_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt21605.kt") public void testKt21605_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines.experimental"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("suspendCovariantJavaOverrides.kt") public void testSuspendCovariantJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCovariantJavaOverrides.kt") public void testSuspendCovariantJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendJavaOverrides.kt") public void testSuspendJavaOverrides_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt", "kotlin.coroutines"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/controlFlow") @@ -6199,164 +6037,142 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInControlFlow() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines"); } @TestMetadata("forContinue.kt") public void testForContinue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forContinue.kt") public void testForContinue_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines"); } @TestMetadata("forStatement.kt") public void testForStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forStatement.kt") public void testForStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines"); } } @@ -6368,116 +6184,102 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInFeatureIntersection() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines"); } @TestMetadata("delegate.kt") public void testDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegate.kt") public void testDelegate_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @@ -6488,164 +6290,142 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInTailrec() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines"); } @TestMetadata("extention.kt") public void testExtention_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extention.kt") public void testExtention_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("sum.kt") public void testSum_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sum.kt") public void testSum_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines"); } } } @@ -6658,128 +6438,112 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt", "kotlin.coroutines"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt", "kotlin.coroutines"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines"); } } @@ -6791,104 +6555,92 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInIntrinsicSemantics() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intrinsicSemantics"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines.experimental"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines"); } } @@ -6930,128 +6682,112 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInNamed() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/localFunctions/named"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines"); } @TestMetadata("extension.kt") public void testExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extension.kt") public void testExtension_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines"); } @TestMetadata("infix.kt") public void testInfix_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infix.kt") public void testInfix_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines"); } } } @@ -7064,104 +6800,92 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInMultiModule() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines"); } } @@ -7173,20 +6897,22 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInRedundantLocalsElimination() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/redundantLocalsElimination"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines"); } } @@ -7198,56 +6924,52 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInStackUnwinding() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/stackUnwinding"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("exception.kt") public void testException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("exception.kt") public void testException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines"); } } @@ -7259,212 +6981,182 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("inline.kt") public void testInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inline.kt") public void testInline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines"); } @TestMetadata("member.kt") public void testMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines.experimental"); } @TestMetadata("member.kt") public void testMember_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines"); } @TestMetadata("openFunWithJava.kt") public void testOpenFunWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("openFunWithJava.kt") public void testOpenFunWithJava_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt", "kotlin.coroutines"); } @TestMetadata("operators.kt") public void testOperators_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines.experimental"); } @TestMetadata("operators.kt") public void testOperators_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines"); } @TestMetadata("superCall.kt") public void testSuperCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCall.kt") public void testSuperCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines"); } } @@ -7476,56 +7168,52 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionTypeCall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("localVal.kt") public void testLocalVal_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localVal.kt") public void testLocalVal_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines"); } } @@ -7537,92 +7225,82 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInTailCallOptimizations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("crossinline.kt") public void testCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossinline.kt") public void testCrossinline_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines"); } } @@ -7634,56 +7312,52 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInTailOperations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailOperations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines"); } } @@ -7695,68 +7369,62 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInUnitTypeReturn() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/unitTypeReturn"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines"); } } @@ -7768,32 +7436,32 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); + } + public void testAllFilesPresentInVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("kt19475.kt") public void testKt19475_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt19475.kt") public void testKt19475_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines"); } } } diff --git a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/RunTestMethodWithPackageReplacementModel.kt b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/RunTestMethodWithPackageReplacementModel.kt new file mode 100644 index 00000000000..60e7f06d162 --- /dev/null +++ b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/RunTestMethodWithPackageReplacementModel.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.generators.tests.generator + +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.utils.Printer + +class RunTestMethodWithPackageReplacementModel( + private val targetBackend: TargetBackend, + private val testMethodName: String, + private val testRunnerMethodName: String +) : MethodModel { + override val name = METHOD_NAME + override val dataString: String? = null + + override fun generateSignature(p: Printer) { + p.print("private void $name(String testDataFilePath, String packageName) throws Exception") + } + + override fun generateBody(p: Printer) { + val className = TargetBackend::class.java.simpleName + p.println("KotlinTestUtils.$testRunnerMethodName(filePath -> $testMethodName(filePath, packageName), $className.$targetBackend, testDataFilePath);") + } + + companion object { + const val METHOD_NAME = "runTestWithPackageReplacement" + } +} \ No newline at end of file diff --git a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java index 0327de7b7a7..09b306b7ac6 100644 --- a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java +++ b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java @@ -137,7 +137,7 @@ public class SimpleTestClassModel implements TestClassModel { if (testMethods == null) { if (!rootFile.isDirectory()) { if (CoroutinesKt.isCommonCoroutineTest(rootFile)) { - testMethods = CoroutinesKt.createCommonCoroutinesTestMethodModels(rootFile, rootFile, doTestMethodName, filenamePattern, + testMethods = CoroutinesKt.createCommonCoroutinesTestMethodModels(rootFile, rootFile, filenamePattern, checkFilenameStartsLowerCase, targetBackend, skipIgnored); } @@ -155,6 +155,9 @@ public class SimpleTestClassModel implements TestClassModel { result.add(new TestAllFilesPresentMethodModel()); File[] listFiles = rootFile.listFiles(); + + boolean hasCoroutines = false; + if (listFiles != null) { for (File file : listFiles) { if (filenamePattern.matcher(file.getName()).matches()) { @@ -164,7 +167,8 @@ public class SimpleTestClassModel implements TestClassModel { } if (!file.isDirectory() && CoroutinesKt.isCommonCoroutineTest(file)) { - result.addAll(CoroutinesKt.createCommonCoroutinesTestMethodModels(rootFile, file, doTestMethodName, + hasCoroutines = true; + result.addAll(CoroutinesKt.createCommonCoroutinesTestMethodModels(rootFile, file, filenamePattern, checkFilenameStartsLowerCase, targetBackend, skipIgnored)); @@ -176,6 +180,12 @@ public class SimpleTestClassModel implements TestClassModel { } } } + + if (hasCoroutines) { + String methodName = doTestMethodName + "WithCoroutinesPackageReplacement"; + result.add(new RunTestMethodWithPackageReplacementModel(targetBackend, methodName, testRunnerMethodName)); + } + result.sort(BY_NAME); testMethods = result; diff --git a/generators/test-generator/tests/org/jetbrains/kotlin/generators/util/coroutines.kt b/generators/test-generator/tests/org/jetbrains/kotlin/generators/util/coroutines.kt index 8d8e1e76aa2..652d764bcbe 100644 --- a/generators/test-generator/tests/org/jetbrains/kotlin/generators/util/coroutines.kt +++ b/generators/test-generator/tests/org/jetbrains/kotlin/generators/util/coroutines.kt @@ -6,8 +6,8 @@ package org.jetbrains.kotlin.generators.util import org.jetbrains.kotlin.generators.tests.generator.MethodModel +import org.jetbrains.kotlin.generators.tests.generator.RunTestMethodWithPackageReplacementModel import org.jetbrains.kotlin.generators.tests.generator.SimpleTestMethodModel -import org.jetbrains.kotlin.test.InTextDirectivesUtils.isIgnoredTarget import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.utils.Printer @@ -17,7 +17,6 @@ import java.util.regex.Pattern class CoroutinesTestModel( rootDir: File, file: File, - private val doTestMethodName: String, filenamePattern: Pattern, checkFilenameStartsLowerCase: Boolean?, targetBackend: TargetBackend, @@ -36,26 +35,9 @@ class CoroutinesTestModel( override fun generateBody(p: Printer) { val filePath = KotlinTestUtils.getFilePath(file) + if (file.isDirectory) "/" else "" - p.println("String fileName = KotlinTestUtils.navigationMetadata(\"", filePath, "\");") - - if (isIgnoredTarget(targetBackend, file)) { - p.println("try {") - p.pushIndent() - } - val packageName = if (isLanguageVersion1_3) "kotlin.coroutines" else "kotlin.coroutines.experimental" - p.println(doTestMethodName + "WithCoroutinesPackageReplacement", "(fileName, \"$packageName\");") - if (isIgnoredTarget(targetBackend, file)) { - p.popIndent() - p.println("}") - p.println("catch (Throwable ignore) {") - p.pushIndent() - p.println("return;") - p.popIndent() - p.println("}") - p.println("throw new AssertionError(\"Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.\");") - } + p.println(RunTestMethodWithPackageReplacementModel.METHOD_NAME, "(\"$filePath\", \"$packageName\");") } } @@ -66,7 +48,6 @@ fun isCommonCoroutineTest(file: File): Boolean { fun createCommonCoroutinesTestMethodModels( rootDir: File, file: File, - doTestMethodName: String, filenamePattern: Pattern, checkFilenameStartsLowerCase: Boolean?, targetBackend: TargetBackend, @@ -77,7 +58,6 @@ fun createCommonCoroutinesTestMethodModels( CoroutinesTestModel( rootDir, file, - doTestMethodName, filenamePattern, checkFilenameStartsLowerCase, targetBackend, @@ -90,7 +70,6 @@ fun createCommonCoroutinesTestMethodModels( CoroutinesTestModel( rootDir, file, - doTestMethodName, filenamePattern, checkFilenameStartsLowerCase, targetBackend, @@ -100,7 +79,6 @@ fun createCommonCoroutinesTestMethodModels( CoroutinesTestModel( rootDir, file, - doTestMethodName, filenamePattern, checkFilenameStartsLowerCase, targetBackend, 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 4945a7d9d80..f5e6673bad5 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 @@ -725,6 +725,10 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInJvm() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/assert/jvm"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @@ -781,50 +785,22 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } } } @@ -3747,6 +3723,10 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/closures/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @@ -3798,14 +3778,7 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines.experimental"); } } @@ -4973,28 +4946,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines.experimental"); } public void testAllFilesPresentInCoroutines() throws Exception { @@ -5003,914 +4966,382 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); } @TestMetadata("await.kt") public void testAwait_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines.experimental"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental"); } @TestMetadata("generate.kt") public void testGenerate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines.experimental"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt12958.kt") public void testKt12958_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15016.kt") public void testKt15016_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15017.kt") public void testKt15017_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15930.kt") public void testKt15930_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt21605.kt") public void testKt21605_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines.experimental"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("compiler/testData/codegen/box/coroutines/controlFlow") @@ -5921,164 +5352,77 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInControlFlow() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forContinue.kt") public void testForContinue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forStatement.kt") public void testForStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines.experimental"); } } @@ -6090,116 +5434,57 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInFeatureIntersection() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegate.kt") public void testDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @@ -6210,164 +5495,77 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInTailrec() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extention.kt") public void testExtention_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sum.kt") public void testSum_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines.experimental"); } } } @@ -6380,104 +5578,52 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines.experimental"); } } @@ -6489,104 +5635,52 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInIntrinsicSemantics() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intrinsicSemantics"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines.experimental"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } } @@ -6628,128 +5722,62 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInNamed() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/localFunctions/named"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extension.kt") public void testExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infix.kt") public void testInfix_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines.experimental"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines.experimental"); } } } @@ -6762,104 +5790,52 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInMultiModule() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines.experimental"); } } @@ -6871,20 +5847,17 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInRedundantLocalsElimination() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/redundantLocalsElimination"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines.experimental"); } } @@ -6896,56 +5869,32 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInStackUnwinding() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/stackUnwinding"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("exception.kt") public void testException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines.experimental"); } } @@ -6957,200 +5906,92 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inline.kt") public void testInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("member.kt") public void testMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("operators.kt") public void testOperators_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCall.kt") public void testSuperCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines.experimental"); } } @@ -7162,56 +6003,32 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionTypeCall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("localVal.kt") public void testLocalVal_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines.experimental"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines.experimental"); } } @@ -7223,92 +6040,47 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInTailCallOptimizations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("crossinline.kt") public void testCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental"); } } @@ -7320,56 +6092,32 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInTailOperations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailOperations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines.experimental"); } } @@ -7381,68 +6129,37 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInUnitTypeReturn() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/unitTypeReturn"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines.experimental"); } } @@ -7454,32 +6171,22 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); + } + public void testAllFilesPresentInVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("kt19475.kt") public void testKt19475_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines.experimental"); } } } 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 322ad031ab9..7ee50a6bb70 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 @@ -725,6 +725,10 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInJvm() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/assert/jvm"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @@ -781,50 +785,22 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("suspendFunctionAssertionDisabled.kt") public void testSuspendFunctionAssertionDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunctionAssertionsEnabled.kt") public void testSuspendFunctionAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsDisabled.kt") public void testSuspendLambdaAssertionsDisabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendLambdaAssertionsEnabled.kt") public void testSuspendLambdaAssertionsEnabled_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt", "kotlin.coroutines.experimental"); } } } @@ -3747,6 +3723,10 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/closures/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @@ -3798,8 +3778,7 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("withCoroutines.kt") public void testWithCoroutines_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt", "kotlin.coroutines.experimental"); } } @@ -4967,16 +4946,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + @TestMetadata("32defaultParametersInSuspend.kt") public void test32defaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("accessorForSuspend.kt") public void testAccessorForSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/accessorForSuspend.kt", "kotlin.coroutines.experimental"); } public void testAllFilesPresentInCoroutines() throws Exception { @@ -4985,464 +4966,382 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("asyncIteratorNullMerge.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIteratorToList.kt") public void testAsyncIteratorToList_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); } @TestMetadata("asyncIterator.kt") public void testAsyncIterator_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/asyncIterator.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); } @TestMetadata("await.kt") public void testAwait_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/await.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/await.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithExceptionNoHandleException.kt") public void testBeginWithExceptionNoHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("beginWithException.kt") public void testBeginWithException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/beginWithException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coercionToUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coercionToUnit.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controllerAccessFromInnerLambda.kt") public void testControllerAccessFromInnerLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextInInlinedLambda.kt") public void testCoroutineContextInInlinedLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/coroutineContextInInlinedLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutineSafe.kt") public void testCreateCoroutineSafe_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutineSafe.kt", "kotlin.coroutines.experimental"); } @TestMetadata("createCoroutinesOnManualInstances.kt") public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/createCoroutinesOnManualInstances.kt", "kotlin.coroutines.experimental"); } @TestMetadata("crossInlineWithCapturedOuterReceiver.kt") public void testCrossInlineWithCapturedOuterReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("defaultParametersInSuspend.kt") public void testDefaultParametersInSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegatedSuspendMember.kt") public void testDelegatedSuspendMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt", "kotlin.coroutines.experimental"); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("emptyClosure.kt") public void testEmptyClosure_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/emptyClosure.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines.experimental"); } @TestMetadata("falseUnitCoercion.kt") public void testFalseUnitCoercion_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental"); } @TestMetadata("generate.kt") public void testGenerate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/generate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/generate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultCallEmptyBody.kt") public void testHandleResultCallEmptyBody_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultNonUnitExpression.kt") public void testHandleResultNonUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleResultSuspended.kt") public void testHandleResultSuspended_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/handleResultSuspended.kt", "kotlin.coroutines.experimental"); } @TestMetadata("indirectInlineUsedAsNonInline.kt") public void testIndirectInlineUsedAsNonInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineFunInGenericClass.kt") public void testInlineFunInGenericClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineGenericFunCalledFromSubclass.kt") public void testInlineGenericFunCalledFromSubclass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("innerSuspensionCalls.kt") public void testInnerSuspensionCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("instanceOfContinuation.kt") public void testInstanceOfContinuation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("iterateOverArray.kt") public void testIterateOverArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/iterateOverArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/iterateOverArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt12958.kt") public void testKt12958_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt12958.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt12958.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15016.kt") public void testKt15016_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15016.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15016.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15017.kt") public void testKt15017_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15017.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15017.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt15930.kt") public void testKt15930_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt15930.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt15930.kt", "kotlin.coroutines.experimental"); } @TestMetadata("kt21605.kt") public void testKt21605_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/kt21605.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/kt21605.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStatementInc.kt") public void testLastStatementInc_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStatementInc.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStatementInc.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastStementAssignment.kt") public void testLastStementAssignment_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastStementAssignment.kt", "kotlin.coroutines.experimental"); } @TestMetadata("lastUnitExpression.kt") public void testLastUnitExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastUnitExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localCallableRef.kt") public void testLocalCallableRef_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); } @TestMetadata("localDelegate.kt") public void testLocalDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localDelegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localDelegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendCall.kt") public void testLongRangeInSuspendCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("longRangeInSuspendFun.kt") public void testLongRangeInSuspendFun_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt", "kotlin.coroutines.experimental"); } @TestMetadata("mergeNullAndString.kt") public void testMergeNullAndString_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/mergeNullAndString.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda1.kt") public void testMultipleInvokeCallsInsideInlineLambda1_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda2.kt") public void testMultipleInvokeCallsInsideInlineLambda2_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCallsInsideInlineLambda3.kt") public void testMultipleInvokeCallsInsideInlineLambda3_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt", "kotlin.coroutines.experimental"); } @TestMetadata("multipleInvokeCalls.kt") public void testMultipleInvokeCalls_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedTryCatch.kt") public void testNestedTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nestedTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noSuspensionPoints.kt") public void testNoSuspensionPoints_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambdaDeep.kt") public void testNonLocalReturnFromInlineLambdaDeep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nonLocalReturnFromInlineLambda.kt") public void testNonLocalReturnFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt", "kotlin.coroutines.experimental"); } @TestMetadata("recursiveSuspend.kt") public void testRecursiveSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/recursiveSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnByLabel.kt") public void testReturnByLabel_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/returnByLabel.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/returnByLabel.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleException.kt") public void testSimpleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleWithHandleResult.kt") public void testSimpleWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("statementLikeLastExpression.kt") public void testStatementLikeLastExpression_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineFromStateMachine.kt") public void testSuspendCoroutineFromStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDefaultImpl.kt") public void testSuspendDefaultImpl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDelegation.kt") public void testSuspendDelegation_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDelegation.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendDelegation.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFromInlineLambda.kt") public void testSuspendFromInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendFunImportedFromObject.kt") public void testSuspendFunImportedFromObject_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInCycle.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt") public void testSuspendInTheMiddleOfObjectConstructionEvaluationOrder_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt") public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInTheMiddleOfObjectConstruction.kt") public void testSuspendInTheMiddleOfObjectConstruction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCallWithElvis.kt") public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspensionInsideSafeCall.kt") public void testSuspensionInsideSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchFinallyWithHandleResult.kt") public void testTryCatchFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatchWithHandleResult.kt") public void testTryCatchWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyInsideInlineLambda.kt") public void testTryFinallyInsideInlineLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryFinallyWithHandleResult.kt") public void testTryFinallyWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt", "kotlin.coroutines.experimental"); } @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("compiler/testData/codegen/box/coroutines/controlFlow") @@ -5453,86 +5352,77 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInControlFlow() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("breakFinally.kt") public void testBreakFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("breakStatement.kt") public void testBreakStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("doWhileStatement.kt") public void testDoWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forContinue.kt") public void testForContinue_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forStatement.kt") public void testForStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("forWithStep.kt") public void testForWithStep_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifStatement.kt") public void testIfStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines.experimental"); } @TestMetadata("labeledWhile.kt") public void testLabeledWhile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnFromFinally.kt") public void testReturnFromFinally_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt", "kotlin.coroutines.experimental"); } @TestMetadata("switchLikeWhen.kt") public void testSwitchLikeWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwFromCatch.kt") public void testThrowFromCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("throwInTryWithHandleResult.kt") public void testThrowInTryWithHandleResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whileStatement.kt") public void testWhileStatement_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt", "kotlin.coroutines.experimental"); } } @@ -5544,62 +5434,57 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInFeatureIntersection() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("breakWithNonEmptyStack.kt") public void testBreakWithNonEmptyStack_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt", "kotlin.coroutines.experimental"); } @TestMetadata("delegate.kt") public void testDelegate_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt", "kotlin.coroutines.experimental"); } @TestMetadata("destructuringInLambdas.kt") public void testDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceiversLong.kt") public void testSafeCallOnTwoReceiversLong_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines.experimental"); } @TestMetadata("safeCallOnTwoReceivers.kt") public void testSafeCallOnTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendDestructuringInLambdas.kt") public void testSuspendDestructuringInLambdas_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusAssign.kt") public void testSuspendOperatorPlusAssign_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlusCallFromLambda.kt") public void testSuspendOperatorPlusCallFromLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendOperatorPlus.kt") public void testSuspendOperatorPlus_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @@ -5610,86 +5495,77 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInTailrec() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("controlFlowIf.kt") public void testControlFlowIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("controlFlowWhen.kt") public void testControlFlowWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/controlFlowWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extention.kt") public void testExtention_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixCall.kt") public void testInfixCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infixRecursiveCall.kt") public void testInfixRecursiveCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/infixRecursiveCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realIteratorFoldl.kt") public void testRealIteratorFoldl_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realIteratorFoldl.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringEscape.kt") public void testRealStringEscape_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringEscape.kt", "kotlin.coroutines.experimental"); } @TestMetadata("realStringRepeat.kt") public void testRealStringRepeat_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/realStringRepeat.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnInParentheses.kt") public void testReturnInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/returnInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sum.kt") public void testSum_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/sum.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInBlockInParentheses.kt") public void testTailCallInBlockInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInBlockInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailCallInParentheses.kt") public void testTailCallInParentheses_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/tailCallInParentheses.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenWithIs.kt") public void testWhenWithIs_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/whenWithIs.kt", "kotlin.coroutines.experimental"); } } } @@ -5702,56 +5578,52 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt", "kotlin.coroutines.experimental"); } @TestMetadata("i2bResult.kt") public void testI2bResult_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt", "kotlin.coroutines.experimental"); } } @@ -5763,56 +5635,52 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInIntrinsicSemantics() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/intrinsicSemantics"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("coroutineContextReceiverNotIntrinsic.kt") public void testCoroutineContextReceiverNotIntrinsic_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiverNotIntrinsic.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContextReceiver.kt") public void testCoroutineContextReceiver_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContextReceiver.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineContext.kt") public void testCoroutineContext_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/coroutineContext.kt", "kotlin.coroutines.experimental"); } @TestMetadata("intercepted.kt") public void testIntercepted_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/intercepted.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturnInterception.kt") public void testStartCoroutineUninterceptedOrReturnInterception_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturnInterception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutineUninterceptedOrReturn.kt") public void testStartCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("startCoroutine.kt") public void testStartCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/intrinsicSemantics/suspendCoroutineUninterceptedOrReturn.kt", "kotlin.coroutines.experimental"); } } @@ -5854,68 +5722,62 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInNamed() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/localFunctions/named"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("capturedParameters.kt") public void testCapturedParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("capturedVariables.kt") public void testCapturedVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt", "kotlin.coroutines.experimental"); } @TestMetadata("extension.kt") public void testExtension_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt", "kotlin.coroutines.experimental"); } @TestMetadata("infix.kt") public void testInfix_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt", "kotlin.coroutines.experimental"); } @TestMetadata("insideLambda.kt") public void testInsideLambda_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nestedLocals.kt") public void testNestedLocals_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/nestedLocals.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simpleSuspensionPoint.kt") public void testSimpleSuspensionPoint_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("stateMachine.kt") public void testStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withArguments.kt") public void testWithArguments_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt", "kotlin.coroutines.experimental"); } } } @@ -5928,62 +5790,52 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInMultiModule() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("inlineFunctionWithOptionalParam.kt") public void testInlineFunctionWithOptionalParam_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleOverride.kt") public void testInlineMultiModuleOverride_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithController.kt") public void testInlineMultiModuleWithController_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModuleWithInnerInlining.kt") public void testInlineMultiModuleWithInnerInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineMultiModule.kt") public void testInlineMultiModule_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTailCall.kt") public void testInlineTailCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineTailCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithJava.kt") public void testInlineWithJava_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineWithJava.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/simple.kt", "kotlin.coroutines.experimental"); } } @@ -5995,14 +5847,17 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInRedundantLocalsElimination() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/redundantLocalsElimination"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("ktor_receivedMessage.kt") public void testKtor_receivedMessage_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/redundantLocalsElimination/ktor_receivedMessage.kt", "kotlin.coroutines.experimental"); } } @@ -6014,32 +5869,32 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInStackUnwinding() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/stackUnwinding"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("exception.kt") public void testException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/exception.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineSuspendFunction.kt") public void testInlineSuspendFunction_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendInCycle.kt") public void testSuspendInCycle_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt", "kotlin.coroutines.experimental"); } } @@ -6051,104 +5906,92 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("dispatchResume.kt") public void testDispatchResume_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/dispatchResume.kt", "kotlin.coroutines.experimental"); } @TestMetadata("handleException.kt") public void testHandleException_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines.experimental"); } @TestMetadata("ifExpressionInsideCoroutine.kt") public void testIfExpressionInsideCoroutine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineTwoReceivers.kt") public void testInlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inline.kt") public void testInline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("member.kt") public void testMember_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt", "kotlin.coroutines.experimental"); } @TestMetadata("noinlineTwoReceivers.kt") public void testNoinlineTwoReceivers_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt", "kotlin.coroutines.experimental"); } @TestMetadata("operators.kt") public void testOperators_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateFunctions.kt") public void testPrivateFunctions_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt", "kotlin.coroutines.experimental"); } @TestMetadata("privateInFile.kt") public void testPrivateInFile_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt", "kotlin.coroutines.experimental"); } @TestMetadata("returnNoSuspend.kt") public void testReturnNoSuspend_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallAbstractClass.kt") public void testSuperCallAbstractClass_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCallInterface.kt") public void testSuperCallInterface_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt", "kotlin.coroutines.experimental"); } @TestMetadata("superCall.kt") public void testSuperCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt", "kotlin.coroutines.experimental"); } @TestMetadata("withVariables.kt") public void testWithVariables_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt", "kotlin.coroutines.experimental"); } } @@ -6160,32 +6003,32 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInSuspendFunctionTypeCall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("localVal.kt") public void testLocalVal_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt", "kotlin.coroutines.experimental"); } @TestMetadata("manyParameters.kt") public void testManyParameters_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendModifier.kt") public void testSuspendModifier_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt", "kotlin.coroutines.experimental"); } } @@ -6197,56 +6040,47 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInTailCallOptimizations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("crossinline.kt") public void testCrossinline_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt"); - try { - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithStateMachine.kt") public void testInlineWithStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("inlineWithoutStateMachine.kt") public void testInlineWithoutStateMachine_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines.experimental"); } @TestMetadata("simple.kt") public void testSimple_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tryCatch.kt") public void testTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unreachable.kt") public void testUnreachable_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental"); } @TestMetadata("whenUnit.kt") public void testWhenUnit_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental"); } } @@ -6258,32 +6092,32 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInTailOperations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailOperations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("suspendWithIf.kt") public void testSuspendWithIf_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithTryCatch.kt") public void testSuspendWithTryCatch_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendWithWhen.kt") public void testSuspendWithWhen_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt", "kotlin.coroutines.experimental"); } @TestMetadata("tailInlining.kt") public void testTailInlining_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailOperations/tailInlining.kt", "kotlin.coroutines.experimental"); } } @@ -6295,38 +6129,37 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInUnitTypeReturn() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/unitTypeReturn"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("coroutineNonLocalReturn.kt") public void testCoroutineNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("coroutineReturn.kt") public void testCoroutineReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendNonLocalReturn.kt") public void testSuspendNonLocalReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("suspendReturn.kt") public void testSuspendReturn_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt", "kotlin.coroutines.experimental"); } @TestMetadata("unitSafeCall.kt") public void testUnitSafeCall_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt", "kotlin.coroutines.experimental"); } } @@ -6338,20 +6171,22 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); + } + public void testAllFilesPresentInVarSpilling() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("kt19475.kt") public void testKt19475_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt", "kotlin.coroutines.experimental"); } @TestMetadata("nullSpilling.kt") public void testNullSpilling_1_2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt"); - doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt", "kotlin.coroutines.experimental"); } } }