diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java similarity index 90% rename from compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java rename to compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index dfda9c6abff..bb8072a0083 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -3,729 +3,831 @@ * 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.fir; +package org.jetbrains.kotlin.test.runners.ir; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/ir/irText") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + @Test public void testAllFilesPresentInIrText() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested @TestMetadata("compiler/testData/ir/irText/classes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Classes extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Classes extends AbstractFir2IrTextTest { + @Test @TestMetadata("abstractMembers.kt") public void testAbstractMembers() throws Exception { runTest("compiler/testData/ir/irText/classes/abstractMembers.kt"); } + @Test public void testAllFilesPresentInClasses() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/classes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/classes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("annotationClasses.kt") public void testAnnotationClasses() throws Exception { runTest("compiler/testData/ir/irText/classes/annotationClasses.kt"); } + @Test @TestMetadata("argumentReorderingInDelegatingConstructorCall.kt") public void testArgumentReorderingInDelegatingConstructorCall() throws Exception { runTest("compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt"); } + @Test @TestMetadata("clashingFakeOverrideSignatures.kt") public void testClashingFakeOverrideSignatures() throws Exception { runTest("compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt"); } + @Test @TestMetadata("classMembers.kt") public void testClassMembers() throws Exception { runTest("compiler/testData/ir/irText/classes/classMembers.kt"); } + @Test @TestMetadata("classes.kt") public void testClasses() throws Exception { runTest("compiler/testData/ir/irText/classes/classes.kt"); } + @Test @TestMetadata("cloneable.kt") public void testCloneable() throws Exception { runTest("compiler/testData/ir/irText/classes/cloneable.kt"); } + @Test @TestMetadata("companionObject.kt") public void testCompanionObject() throws Exception { runTest("compiler/testData/ir/irText/classes/companionObject.kt"); } + @Test @TestMetadata("dataClassWithArrayMembers.kt") public void testDataClassWithArrayMembers() throws Exception { runTest("compiler/testData/ir/irText/classes/dataClassWithArrayMembers.kt"); } + @Test @TestMetadata("dataClasses.kt") public void testDataClasses() throws Exception { runTest("compiler/testData/ir/irText/classes/dataClasses.kt"); } + @Test @TestMetadata("dataClassesGeneric.kt") public void testDataClassesGeneric() throws Exception { runTest("compiler/testData/ir/irText/classes/dataClassesGeneric.kt"); } + @Test @TestMetadata("delegatedGenericImplementation.kt") public void testDelegatedGenericImplementation() throws Exception { runTest("compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt"); } + @Test @TestMetadata("delegatedImplementation.kt") public void testDelegatedImplementation() throws Exception { runTest("compiler/testData/ir/irText/classes/delegatedImplementation.kt"); } + @Test @TestMetadata("delegatedImplementationOfJavaInterface.kt") public void testDelegatedImplementationOfJavaInterface() throws Exception { runTest("compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt"); } + @Test @TestMetadata("delegatedImplementationWithExplicitOverride.kt") public void testDelegatedImplementationWithExplicitOverride() throws Exception { runTest("compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt"); } + @Test @TestMetadata("delegatingConstructorCallToTypeAliasConstructor.kt") public void testDelegatingConstructorCallToTypeAliasConstructor() throws Exception { runTest("compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt"); } + @Test @TestMetadata("delegatingConstructorCallsInSecondaryConstructors.kt") public void testDelegatingConstructorCallsInSecondaryConstructors() throws Exception { runTest("compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.kt"); } + @Test @TestMetadata("enum.kt") public void testEnum() throws Exception { runTest("compiler/testData/ir/irText/classes/enum.kt"); } + @Test @TestMetadata("enumClassModality.kt") public void testEnumClassModality() throws Exception { runTest("compiler/testData/ir/irText/classes/enumClassModality.kt"); } + @Test @TestMetadata("enumWithMultipleCtors.kt") public void testEnumWithMultipleCtors() throws Exception { runTest("compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt"); } + @Test @TestMetadata("enumWithSecondaryCtor.kt") public void testEnumWithSecondaryCtor() throws Exception { runTest("compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt"); } + @Test @TestMetadata("fakeOverridesForJavaStaticMembers.kt") public void testFakeOverridesForJavaStaticMembers() throws Exception { runTest("compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.kt"); } + @Test @TestMetadata("implicitNotNullOnDelegatedImplementation.kt") public void testImplicitNotNullOnDelegatedImplementation() throws Exception { runTest("compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt"); } + @Test @TestMetadata("initBlock.kt") public void testInitBlock() throws Exception { runTest("compiler/testData/ir/irText/classes/initBlock.kt"); } + @Test @TestMetadata("initVal.kt") public void testInitVal() throws Exception { runTest("compiler/testData/ir/irText/classes/initVal.kt"); } + @Test @TestMetadata("initValInLambda.kt") public void testInitValInLambda() throws Exception { runTest("compiler/testData/ir/irText/classes/initValInLambda.kt"); } + @Test @TestMetadata("initVar.kt") public void testInitVar() throws Exception { runTest("compiler/testData/ir/irText/classes/initVar.kt"); } + @Test @TestMetadata("inlineClass.kt") public void testInlineClass() throws Exception { runTest("compiler/testData/ir/irText/classes/inlineClass.kt"); } + @Test @TestMetadata("inlineClassSyntheticMethods.kt") public void testInlineClassSyntheticMethods() throws Exception { runTest("compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt"); } + @Test @TestMetadata("innerClass.kt") public void testInnerClass() throws Exception { runTest("compiler/testData/ir/irText/classes/innerClass.kt"); } + @Test @TestMetadata("innerClassWithDelegatingConstructor.kt") public void testInnerClassWithDelegatingConstructor() throws Exception { runTest("compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.kt"); } + @Test @TestMetadata("kt19306.kt") public void testKt19306() throws Exception { runTest("compiler/testData/ir/irText/classes/kt19306.kt"); } + @Test @TestMetadata("kt31649.kt") public void testKt31649() throws Exception { runTest("compiler/testData/ir/irText/classes/kt31649.kt"); } + @Test @TestMetadata("kt43217.kt") public void testKt43217() throws Exception { runTest("compiler/testData/ir/irText/classes/kt43217.kt"); } + @Test @TestMetadata("lambdaInDataClassDefaultParameter.kt") public void testLambdaInDataClassDefaultParameter() throws Exception { runTest("compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.kt"); } + @Test @TestMetadata("localClasses.kt") public void testLocalClasses() throws Exception { runTest("compiler/testData/ir/irText/classes/localClasses.kt"); } + @Test @TestMetadata("objectLiteralExpressions.kt") public void testObjectLiteralExpressions() throws Exception { runTest("compiler/testData/ir/irText/classes/objectLiteralExpressions.kt"); } + @Test @TestMetadata("objectWithInitializers.kt") public void testObjectWithInitializers() throws Exception { runTest("compiler/testData/ir/irText/classes/objectWithInitializers.kt"); } + @Test @TestMetadata("openDataClass.kt") public void testOpenDataClass() throws Exception { runTest("compiler/testData/ir/irText/classes/openDataClass.kt"); } + @Test @TestMetadata("outerClassAccess.kt") public void testOuterClassAccess() throws Exception { runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { runTest("compiler/testData/ir/irText/classes/primaryConstructor.kt"); } + @Test @TestMetadata("primaryConstructorWithSuperConstructorCall.kt") public void testPrimaryConstructorWithSuperConstructorCall() throws Exception { runTest("compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.kt"); } + @Test @TestMetadata("qualifiedSuperCalls.kt") public void testQualifiedSuperCalls() throws Exception { runTest("compiler/testData/ir/irText/classes/qualifiedSuperCalls.kt"); } + @Test @TestMetadata("sealedClasses.kt") public void testSealedClasses() throws Exception { runTest("compiler/testData/ir/irText/classes/sealedClasses.kt"); } + @Test @TestMetadata("secondaryConstructorWithInitializersFromClassBody.kt") public void testSecondaryConstructorWithInitializersFromClassBody() throws Exception { runTest("compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.kt"); } + @Test @TestMetadata("secondaryConstructors.kt") public void testSecondaryConstructors() throws Exception { runTest("compiler/testData/ir/irText/classes/secondaryConstructors.kt"); } + @Test @TestMetadata("superCalls.kt") public void testSuperCalls() throws Exception { runTest("compiler/testData/ir/irText/classes/superCalls.kt"); } + @Test @TestMetadata("superCallsComposed.kt") public void testSuperCallsComposed() throws Exception { runTest("compiler/testData/ir/irText/classes/superCallsComposed.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/declarations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Declarations extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Declarations extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInDeclarations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("catchParameterInTopLevelProperty.kt") public void testCatchParameterInTopLevelProperty() throws Exception { runTest("compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt"); } + @Test @TestMetadata("classLevelProperties.kt") public void testClassLevelProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/classLevelProperties.kt"); } + @Test @TestMetadata("constValInitializers.kt") public void testConstValInitializers() throws Exception { runTest("compiler/testData/ir/irText/declarations/constValInitializers.kt"); } + @Test @TestMetadata("defaultArguments.kt") public void testDefaultArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/defaultArguments.kt"); } + @Test @TestMetadata("delegatedProperties.kt") public void testDelegatedProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/delegatedProperties.kt"); } + @Test @TestMetadata("deprecatedProperty.kt") public void testDeprecatedProperty() throws Exception { runTest("compiler/testData/ir/irText/declarations/deprecatedProperty.kt"); } + @Test @TestMetadata("extensionProperties.kt") public void testExtensionProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/extensionProperties.kt"); } + @Test @TestMetadata("fakeOverrides.kt") public void testFakeOverrides() throws Exception { runTest("compiler/testData/ir/irText/declarations/fakeOverrides.kt"); } + @Test @TestMetadata("fileWithAnnotations.kt") public void testFileWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/fileWithAnnotations.kt"); } + @Test @TestMetadata("fileWithTypeAliasesOnly.kt") public void testFileWithTypeAliasesOnly() throws Exception { runTest("compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.kt"); } + @Test @TestMetadata("genericDelegatedProperty.kt") public void testGenericDelegatedProperty() throws Exception { runTest("compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt"); } + @Test @TestMetadata("inlineCollectionOfInlineClass.kt") public void testInlineCollectionOfInlineClass() throws Exception { runTest("compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt"); } + @Test @TestMetadata("interfaceProperties.kt") public void testInterfaceProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/interfaceProperties.kt"); } + @Test @TestMetadata("kt27005.kt") public void testKt27005() throws Exception { runTest("compiler/testData/ir/irText/declarations/kt27005.kt"); } + @Test @TestMetadata("kt29833.kt") public void testKt29833() throws Exception { runTest("compiler/testData/ir/irText/declarations/kt29833.kt"); } + @Test @TestMetadata("kt35550.kt") public void testKt35550() throws Exception { runTest("compiler/testData/ir/irText/declarations/kt35550.kt"); } + @Test @TestMetadata("localClassWithOverrides.kt") public void testLocalClassWithOverrides() throws Exception { runTest("compiler/testData/ir/irText/declarations/localClassWithOverrides.kt"); } + @Test @TestMetadata("localDelegatedProperties.kt") public void testLocalDelegatedProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/localDelegatedProperties.kt"); } + @Test @TestMetadata("localVarInDoWhile.kt") public void testLocalVarInDoWhile() throws Exception { runTest("compiler/testData/ir/irText/declarations/localVarInDoWhile.kt"); } + @Test @TestMetadata("packageLevelProperties.kt") public void testPackageLevelProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/packageLevelProperties.kt"); } + @Test @TestMetadata("primaryCtorDefaultArguments.kt") public void testPrimaryCtorDefaultArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt"); } + @Test @TestMetadata("primaryCtorProperties.kt") public void testPrimaryCtorProperties() throws Exception { runTest("compiler/testData/ir/irText/declarations/primaryCtorProperties.kt"); } + @Test @TestMetadata("typeAlias.kt") public void testTypeAlias() throws Exception { runTest("compiler/testData/ir/irText/declarations/typeAlias.kt"); } + @Nested @TestMetadata("compiler/testData/ir/irText/declarations/annotations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Annotations extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Annotations extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInAnnotations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/annotations"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("annotationsInAnnotationArguments.kt") public void testAnnotationsInAnnotationArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt"); } + @Test @TestMetadata("annotationsOnDelegatedMembers.kt") public void testAnnotationsOnDelegatedMembers() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt"); } + @Test @TestMetadata("annotationsWithDefaultParameterValues.kt") public void testAnnotationsWithDefaultParameterValues() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.kt"); } + @Test @TestMetadata("annotationsWithVarargParameters.kt") public void testAnnotationsWithVarargParameters() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.kt"); } + @Test @TestMetadata("arrayInAnnotationArguments.kt") public void testArrayInAnnotationArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt"); } + @Test @TestMetadata("classLiteralInAnnotation.kt") public void testClassLiteralInAnnotation() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.kt"); } + @Test @TestMetadata("classesWithAnnotations.kt") public void testClassesWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt"); } + @Test @TestMetadata("constExpressionsInAnnotationArguments.kt") public void testConstExpressionsInAnnotationArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt"); } + @Test @TestMetadata("constructorsWithAnnotations.kt") public void testConstructorsWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt"); } + @Test @TestMetadata("delegateFieldWithAnnotations.kt") public void testDelegateFieldWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt"); } + @Test @TestMetadata("delegatedPropertyAccessorsWithAnnotations.kt") public void testDelegatedPropertyAccessorsWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt"); } + @Test @TestMetadata("enumEntriesWithAnnotations.kt") public void testEnumEntriesWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt"); } + @Test @TestMetadata("enumsInAnnotationArguments.kt") public void testEnumsInAnnotationArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt"); } + @Test @TestMetadata("fieldsWithAnnotations.kt") public void testFieldsWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt"); } + @Test @TestMetadata("fileAnnotations.kt") public void testFileAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/fileAnnotations.kt"); } + @Test @TestMetadata("functionsWithAnnotations.kt") public void testFunctionsWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt"); } + @Test @TestMetadata("inheritingDeprecation.kt") public void testInheritingDeprecation() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt"); } + @Test @TestMetadata("javaAnnotation.kt") public void testJavaAnnotation() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/javaAnnotation.kt"); } + @Test @TestMetadata("localDelegatedPropertiesWithAnnotations.kt") public void testLocalDelegatedPropertiesWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.kt"); } + @Test @TestMetadata("multipleAnnotationsInSquareBrackets.kt") public void testMultipleAnnotationsInSquareBrackets() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.kt"); } + @Test @TestMetadata("primaryConstructorParameterWithAnnotations.kt") public void testPrimaryConstructorParameterWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt"); } + @Test @TestMetadata("propertiesWithAnnotations.kt") public void testPropertiesWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt"); } + @Test @TestMetadata("propertyAccessorsFromClassHeaderWithAnnotations.kt") public void testPropertyAccessorsFromClassHeaderWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.kt"); } + @Test @TestMetadata("propertyAccessorsWithAnnotations.kt") public void testPropertyAccessorsWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt"); } + @Test @TestMetadata("propertySetterParameterWithAnnotations.kt") public void testPropertySetterParameterWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt"); } + @Test @TestMetadata("receiverParameterWithAnnotations.kt") public void testReceiverParameterWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt"); } + @Test @TestMetadata("spreadOperatorInAnnotationArguments.kt") public void testSpreadOperatorInAnnotationArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt"); } + @Test @TestMetadata("typeAliasesWithAnnotations.kt") public void testTypeAliasesWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt"); } + @Test @TestMetadata("typeParametersWithAnnotations.kt") public void testTypeParametersWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.kt"); } + @Test @TestMetadata("valueParametersWithAnnotations.kt") public void testValueParametersWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt"); } + @Test @TestMetadata("varargsInAnnotationArguments.kt") public void testVarargsInAnnotationArguments() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt"); } + @Test @TestMetadata("variablesWithAnnotations.kt") public void testVariablesWithAnnotations() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/declarations/multiplatform") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Multiplatform extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Multiplatform extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInMultiplatform() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/multiplatform"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/multiplatform"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("expectClassInherited.kt") public void testExpectClassInherited() throws Exception { runTest("compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.kt"); } + @Test @TestMetadata("expectedEnumClass.kt") public void testExpectedEnumClass() throws Exception { runTest("compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.kt"); } + @Test @TestMetadata("expectedSealedClass.kt") public void testExpectedSealedClass() throws Exception { runTest("compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/declarations/parameters") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Parameters extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Parameters extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInParameters() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/parameters"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/parameters"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("class.kt") public void testClass() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/class.kt"); } + @Test @TestMetadata("constructor.kt") public void testConstructor() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/constructor.kt"); } + @Test @TestMetadata("dataClassMembers.kt") public void testDataClassMembers() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt"); } + @Test @TestMetadata("defaultPropertyAccessors.kt") public void testDefaultPropertyAccessors() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt"); } + @Test @TestMetadata("delegatedMembers.kt") public void testDelegatedMembers() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt"); } + @Test @TestMetadata("fun.kt") public void testFun() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/fun.kt"); } + @Test @TestMetadata("genericInnerClass.kt") public void testGenericInnerClass() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt"); } + @Test @TestMetadata("lambdas.kt") public void testLambdas() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/lambdas.kt"); } + @Test @TestMetadata("localFun.kt") public void testLocalFun() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/localFun.kt"); } + @Test @TestMetadata("propertyAccessors.kt") public void testPropertyAccessors() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt"); } + @Test @TestMetadata("typeParameterBeforeBound.kt") public void testTypeParameterBeforeBound() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt"); } + @Test @TestMetadata("typeParameterBoundedBySubclass.kt") public void testTypeParameterBoundedBySubclass() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt"); } + @Test @TestMetadata("useNextParamInLambda.kt") public void testUseNextParamInLambda() throws Exception { runTest("compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/declarations/provideDelegate") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ProvideDelegate extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ProvideDelegate extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInProvideDelegate() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/declarations/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("differentReceivers.kt") public void testDifferentReceivers() throws Exception { runTest("compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt"); } + @Test @TestMetadata("local.kt") public void testLocal() throws Exception { runTest("compiler/testData/ir/irText/declarations/provideDelegate/local.kt"); } + @Test @TestMetadata("localDifferentReceivers.kt") public void testLocalDifferentReceivers() throws Exception { runTest("compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt"); } + @Test @TestMetadata("member.kt") public void testMember() throws Exception { runTest("compiler/testData/ir/irText/declarations/provideDelegate/member.kt"); } + @Test @TestMetadata("memberExtension.kt") public void testMemberExtension() throws Exception { runTest("compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt"); } + @Test @TestMetadata("topLevel.kt") public void testTopLevel() throws Exception { runTest("compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt"); @@ -733,1037 +835,1211 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { } } + @Nested @TestMetadata("compiler/testData/ir/irText/errors") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Errors extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Errors extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInErrors() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/errors"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/errors"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("suppressedNonPublicCall.kt") public void testSuppressedNonPublicCall() throws Exception { runTest("compiler/testData/ir/irText/errors/suppressedNonPublicCall.kt"); } + @Test @TestMetadata("unresolvedReference.kt") public void testUnresolvedReference() throws Exception { runTest("compiler/testData/ir/irText/errors/unresolvedReference.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Expressions extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Expressions extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInExpressions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("argumentMappedWithError.kt") public void testArgumentMappedWithError() throws Exception { runTest("compiler/testData/ir/irText/expressions/argumentMappedWithError.kt"); } + @Test @TestMetadata("arrayAccess.kt") public void testArrayAccess() throws Exception { runTest("compiler/testData/ir/irText/expressions/arrayAccess.kt"); } + @Test @TestMetadata("arrayAssignment.kt") public void testArrayAssignment() throws Exception { runTest("compiler/testData/ir/irText/expressions/arrayAssignment.kt"); } + @Test @TestMetadata("arrayAugmentedAssignment1.kt") public void testArrayAugmentedAssignment1() throws Exception { runTest("compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt"); } + @Test @TestMetadata("arrayAugmentedAssignment2.kt") public void testArrayAugmentedAssignment2() throws Exception { runTest("compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.kt"); } + @Test @TestMetadata("assignments.kt") public void testAssignments() throws Exception { runTest("compiler/testData/ir/irText/expressions/assignments.kt"); } + @Test @TestMetadata("augmentedAssignment1.kt") public void testAugmentedAssignment1() throws Exception { runTest("compiler/testData/ir/irText/expressions/augmentedAssignment1.kt"); } + @Test @TestMetadata("augmentedAssignment2.kt") public void testAugmentedAssignment2() throws Exception { runTest("compiler/testData/ir/irText/expressions/augmentedAssignment2.kt"); } + @Test @TestMetadata("augmentedAssignmentWithExpression.kt") public void testAugmentedAssignmentWithExpression() throws Exception { runTest("compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.kt"); } + @Test @TestMetadata("badBreakContinue.kt") public void testBadBreakContinue() throws Exception { runTest("compiler/testData/ir/irText/expressions/badBreakContinue.kt"); } + @Test @TestMetadata("bangbang.kt") public void testBangbang() throws Exception { runTest("compiler/testData/ir/irText/expressions/bangbang.kt"); } + @Test @TestMetadata("booleanConstsInAndAndOrOr.kt") public void testBooleanConstsInAndAndOrOr() throws Exception { runTest("compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.kt"); } + @Test @TestMetadata("booleanOperators.kt") public void testBooleanOperators() throws Exception { runTest("compiler/testData/ir/irText/expressions/booleanOperators.kt"); } + @Test @TestMetadata("boundCallableReferences.kt") public void testBoundCallableReferences() throws Exception { runTest("compiler/testData/ir/irText/expressions/boundCallableReferences.kt"); } + @Test @TestMetadata("boxOk.kt") public void testBoxOk() throws Exception { runTest("compiler/testData/ir/irText/expressions/boxOk.kt"); } + @Test @TestMetadata("breakContinue.kt") public void testBreakContinue() throws Exception { runTest("compiler/testData/ir/irText/expressions/breakContinue.kt"); } + @Test @TestMetadata("breakContinueInLoopHeader.kt") public void testBreakContinueInLoopHeader() throws Exception { runTest("compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.kt"); } + @Test @TestMetadata("breakContinueInWhen.kt") public void testBreakContinueInWhen() throws Exception { runTest("compiler/testData/ir/irText/expressions/breakContinueInWhen.kt"); } + @Test @TestMetadata("callWithReorderedArguments.kt") public void testCallWithReorderedArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/callWithReorderedArguments.kt"); } + @Test @TestMetadata("calls.kt") public void testCalls() throws Exception { runTest("compiler/testData/ir/irText/expressions/calls.kt"); } + @Test @TestMetadata("castToTypeParameter.kt") public void testCastToTypeParameter() throws Exception { runTest("compiler/testData/ir/irText/expressions/castToTypeParameter.kt"); } + @Test @TestMetadata("catchParameterAccess.kt") public void testCatchParameterAccess() throws Exception { runTest("compiler/testData/ir/irText/expressions/catchParameterAccess.kt"); } + @Test @TestMetadata("chainOfSafeCalls.kt") public void testChainOfSafeCalls() throws Exception { runTest("compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt"); } + @Test @TestMetadata("classReference.kt") public void testClassReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/classReference.kt"); } + @Test @TestMetadata("coercionToUnit.kt") public void testCoercionToUnit() throws Exception { runTest("compiler/testData/ir/irText/expressions/coercionToUnit.kt"); } + @Test @TestMetadata("complexAugmentedAssignment.kt") public void testComplexAugmentedAssignment() throws Exception { runTest("compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt"); } + @Test @TestMetadata("constructorWithOwnTypeParametersCall.kt") public void testConstructorWithOwnTypeParametersCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt"); } + @Test @TestMetadata("contructorCall.kt") public void testContructorCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/contructorCall.kt"); } + @Test @TestMetadata("conventionComparisons.kt") public void testConventionComparisons() throws Exception { runTest("compiler/testData/ir/irText/expressions/conventionComparisons.kt"); } + @Test @TestMetadata("destructuring1.kt") public void testDestructuring1() throws Exception { runTest("compiler/testData/ir/irText/expressions/destructuring1.kt"); } + @Test @TestMetadata("destructuringWithUnderscore.kt") public void testDestructuringWithUnderscore() throws Exception { runTest("compiler/testData/ir/irText/expressions/destructuringWithUnderscore.kt"); } + @Test @TestMetadata("dotQualified.kt") public void testDotQualified() throws Exception { runTest("compiler/testData/ir/irText/expressions/dotQualified.kt"); } + @Test @TestMetadata("elvis.kt") public void testElvis() throws Exception { runTest("compiler/testData/ir/irText/expressions/elvis.kt"); } + @Test @TestMetadata("enumEntryAsReceiver.kt") public void testEnumEntryAsReceiver() throws Exception { runTest("compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt"); } + @Test @TestMetadata("enumEntryReferenceFromEnumEntryClass.kt") public void testEnumEntryReferenceFromEnumEntryClass() throws Exception { runTest("compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt"); } + @Test @TestMetadata("equality.kt") public void testEquality() throws Exception { runTest("compiler/testData/ir/irText/expressions/equality.kt"); } + @Test @TestMetadata("equals.kt") public void testEquals() throws Exception { runTest("compiler/testData/ir/irText/expressions/equals.kt"); } + @Test @TestMetadata("exhaustiveWhenElseBranch.kt") public void testExhaustiveWhenElseBranch() throws Exception { runTest("compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt"); } + @Test @TestMetadata("extFunInvokeAsFun.kt") public void testExtFunInvokeAsFun() throws Exception { runTest("compiler/testData/ir/irText/expressions/extFunInvokeAsFun.kt"); } + @Test @TestMetadata("extFunSafeInvoke.kt") public void testExtFunSafeInvoke() throws Exception { runTest("compiler/testData/ir/irText/expressions/extFunSafeInvoke.kt"); } + @Test @TestMetadata("extensionPropertyGetterCall.kt") public void testExtensionPropertyGetterCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt"); } + @Test @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/ir/irText/expressions/field.kt"); } + @Test @TestMetadata("for.kt") public void testFor() throws Exception { runTest("compiler/testData/ir/irText/expressions/for.kt"); } + @Test @TestMetadata("forWithBreakContinue.kt") public void testForWithBreakContinue() throws Exception { runTest("compiler/testData/ir/irText/expressions/forWithBreakContinue.kt"); } + @Test @TestMetadata("forWithImplicitReceivers.kt") public void testForWithImplicitReceivers() throws Exception { runTest("compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt"); } + @Test @TestMetadata("funImportedFromObject.kt") public void testFunImportedFromObject() throws Exception { runTest("compiler/testData/ir/irText/expressions/funImportedFromObject.kt"); } + @Test @TestMetadata("genericConstructorCallWithTypeArguments.kt") public void testGenericConstructorCallWithTypeArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt"); } + @Test @TestMetadata("genericPropertyCall.kt") public void testGenericPropertyCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/genericPropertyCall.kt"); } + @Test @TestMetadata("genericPropertyRef.kt") public void testGenericPropertyRef() throws Exception { runTest("compiler/testData/ir/irText/expressions/genericPropertyRef.kt"); } + @Test @TestMetadata("identity.kt") public void testIdentity() throws Exception { runTest("compiler/testData/ir/irText/expressions/identity.kt"); } + @Test @TestMetadata("ifElseIf.kt") public void testIfElseIf() throws Exception { runTest("compiler/testData/ir/irText/expressions/ifElseIf.kt"); } + @Test @TestMetadata("implicitCastInReturnFromConstructor.kt") public void testImplicitCastInReturnFromConstructor() throws Exception { runTest("compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.kt"); } + @Test @TestMetadata("implicitCastOnPlatformType.kt") public void testImplicitCastOnPlatformType() throws Exception { runTest("compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.kt"); } + @Test @TestMetadata("implicitCastToNonNull.kt") public void testImplicitCastToNonNull() throws Exception { runTest("compiler/testData/ir/irText/expressions/implicitCastToNonNull.kt"); } + @Test @TestMetadata("implicitCastToTypeParameter.kt") public void testImplicitCastToTypeParameter() throws Exception { runTest("compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt"); } + @Test @TestMetadata("implicitNotNullInDestructuringAssignment.kt") public void testImplicitNotNullInDestructuringAssignment() throws Exception { runTest("compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.kt"); } + @Test @TestMetadata("in.kt") public void testIn() throws Exception { runTest("compiler/testData/ir/irText/expressions/in.kt"); } + @Test @TestMetadata("incrementDecrement.kt") public void testIncrementDecrement() throws Exception { runTest("compiler/testData/ir/irText/expressions/incrementDecrement.kt"); } + @Test @TestMetadata("interfaceThisRef.kt") public void testInterfaceThisRef() throws Exception { runTest("compiler/testData/ir/irText/expressions/interfaceThisRef.kt"); } - @TestMetadata("javaSyntheticGenericPropertyAccess.kt") - public void testJavaSyntheticGenericPropertyAccess() throws Exception { - runTest("compiler/testData/ir/irText/expressions/javaSyntheticGenericPropertyAccess.kt"); + @Test + @TestMetadata("javaSyntheticGenericPropretyAccess.kt") + public void testJavaSyntheticGenericPropretyAccess() throws Exception { + runTest("compiler/testData/ir/irText/expressions/javaSyntheticGenericPropretyAccess.kt"); } + @Test @TestMetadata("javaSyntheticPropertyAccess.kt") public void testJavaSyntheticPropertyAccess() throws Exception { runTest("compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.kt"); } + @Test @TestMetadata("jvmFieldReferenceWithIntersectionTypes.kt") public void testJvmFieldReferenceWithIntersectionTypes() throws Exception { runTest("compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt"); } + @Test @TestMetadata("jvmInstanceFieldReference.kt") public void testJvmInstanceFieldReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt"); } + @Test @TestMetadata("jvmStaticFieldReference.kt") public void testJvmStaticFieldReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/jvmStaticFieldReference.kt"); } + @Test @TestMetadata("kt16904.kt") public void testKt16904() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt16904.kt"); } + @Test @TestMetadata("kt16905.kt") public void testKt16905() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt16905.kt"); } + @Test @TestMetadata("kt23030.kt") public void testKt23030() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt23030.kt"); } + @Test @TestMetadata("kt24804.kt") public void testKt24804() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt24804.kt"); } + @Test @TestMetadata("kt27933.kt") public void testKt27933() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt27933.kt"); } + @Test @TestMetadata("kt28006.kt") public void testKt28006() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt28006.kt"); } + @Test @TestMetadata("kt28456.kt") public void testKt28456() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt28456.kt"); } + @Test @TestMetadata("kt28456a.kt") public void testKt28456a() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt28456a.kt"); } + @Test @TestMetadata("kt28456b.kt") public void testKt28456b() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt28456b.kt"); } + @Test @TestMetadata("kt30020.kt") public void testKt30020() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt30020.kt"); } + @Test @TestMetadata("kt30796.kt") public void testKt30796() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt30796.kt"); } + @Test @TestMetadata("kt35730.kt") public void testKt35730() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt35730.kt"); } + @Test @TestMetadata("kt36956.kt") public void testKt36956() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt36956.kt"); } + @Test @TestMetadata("kt36963.kt") public void testKt36963() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt36963.kt"); } + @Test @TestMetadata("kt37570.kt") public void testKt37570() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt37570.kt"); } + @Test @TestMetadata("kt37779.kt") public void testKt37779() throws Exception { runTest("compiler/testData/ir/irText/expressions/kt37779.kt"); } + @Test @TestMetadata("lambdaInCAO.kt") public void testLambdaInCAO() throws Exception { runTest("compiler/testData/ir/irText/expressions/lambdaInCAO.kt"); } + @Test @TestMetadata("literals.kt") public void testLiterals() throws Exception { runTest("compiler/testData/ir/irText/expressions/literals.kt"); } + @Test @TestMetadata("memberTypeArguments.kt") public void testMemberTypeArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/memberTypeArguments.kt"); } + @Test @TestMetadata("membersImportedFromObject.kt") public void testMembersImportedFromObject() throws Exception { runTest("compiler/testData/ir/irText/expressions/membersImportedFromObject.kt"); } + @Test @TestMetadata("multipleSmartCasts.kt") public void testMultipleSmartCasts() throws Exception { runTest("compiler/testData/ir/irText/expressions/multipleSmartCasts.kt"); } + @Test @TestMetadata("multipleThisReferences.kt") public void testMultipleThisReferences() throws Exception { runTest("compiler/testData/ir/irText/expressions/multipleThisReferences.kt"); } + @Test @TestMetadata("nullCheckOnGenericLambdaReturn.kt") public void testNullCheckOnGenericLambdaReturn() throws Exception { runTest("compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt"); } + @Test @TestMetadata("nullCheckOnLambdaReturn.kt") public void testNullCheckOnLambdaReturn() throws Exception { runTest("compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.kt"); } + @Test @TestMetadata("objectAsCallable.kt") public void testObjectAsCallable() throws Exception { runTest("compiler/testData/ir/irText/expressions/objectAsCallable.kt"); } + @Test @TestMetadata("objectByNameInsideObject.kt") public void testObjectByNameInsideObject() throws Exception { runTest("compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt"); } + @Test @TestMetadata("objectClassReference.kt") public void testObjectClassReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/objectClassReference.kt"); } + @Test @TestMetadata("objectReference.kt") public void testObjectReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/objectReference.kt"); } + @Test @TestMetadata("objectReferenceInClosureInSuperConstructorCall.kt") public void testObjectReferenceInClosureInSuperConstructorCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt"); } + @Test @TestMetadata("objectReferenceInFieldInitializer.kt") public void testObjectReferenceInFieldInitializer() throws Exception { runTest("compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.kt"); } + @Test @TestMetadata("outerClassInstanceReference.kt") public void testOuterClassInstanceReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/outerClassInstanceReference.kt"); } + @Test @TestMetadata("primitiveComparisons.kt") public void testPrimitiveComparisons() throws Exception { runTest("compiler/testData/ir/irText/expressions/primitiveComparisons.kt"); } + @Test @TestMetadata("primitivesImplicitConversions.kt") public void testPrimitivesImplicitConversions() throws Exception { runTest("compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt"); } + @Test @TestMetadata("propertyReferences.kt") public void testPropertyReferences() throws Exception { runTest("compiler/testData/ir/irText/expressions/propertyReferences.kt"); } + @Test @TestMetadata("references.kt") public void testReferences() throws Exception { runTest("compiler/testData/ir/irText/expressions/references.kt"); } + @Test @TestMetadata("reflectionLiterals.kt") public void testReflectionLiterals() throws Exception { runTest("compiler/testData/ir/irText/expressions/reflectionLiterals.kt"); } + @Test @TestMetadata("safeAssignment.kt") public void testSafeAssignment() throws Exception { runTest("compiler/testData/ir/irText/expressions/safeAssignment.kt"); } + @Test @TestMetadata("safeCallWithIncrementDecrement.kt") public void testSafeCallWithIncrementDecrement() throws Exception { runTest("compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt"); } + @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { runTest("compiler/testData/ir/irText/expressions/safeCalls.kt"); } + @Test @TestMetadata("setFieldWithImplicitCast.kt") public void testSetFieldWithImplicitCast() throws Exception { runTest("compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.kt"); } + @Test @TestMetadata("signedToUnsignedConversions.kt") public void testSignedToUnsignedConversions() throws Exception { runTest("compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt"); } + @Test @TestMetadata("simpleOperators.kt") public void testSimpleOperators() throws Exception { runTest("compiler/testData/ir/irText/expressions/simpleOperators.kt"); } + @Test @TestMetadata("simpleUnaryOperators.kt") public void testSimpleUnaryOperators() throws Exception { runTest("compiler/testData/ir/irText/expressions/simpleUnaryOperators.kt"); } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { runTest("compiler/testData/ir/irText/expressions/smartCasts.kt"); } + @Test @TestMetadata("smartCastsWithDestructuring.kt") public void testSmartCastsWithDestructuring() throws Exception { runTest("compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.kt"); } + @Test @TestMetadata("specializedTypeAliasConstructorCall.kt") public void testSpecializedTypeAliasConstructorCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt"); } + @Test @TestMetadata("stringComparisons.kt") public void testStringComparisons() throws Exception { runTest("compiler/testData/ir/irText/expressions/stringComparisons.kt"); } + @Test @TestMetadata("stringPlus.kt") public void testStringPlus() throws Exception { runTest("compiler/testData/ir/irText/expressions/stringPlus.kt"); } + @Test @TestMetadata("stringTemplates.kt") public void testStringTemplates() throws Exception { runTest("compiler/testData/ir/irText/expressions/stringTemplates.kt"); } + @Test @TestMetadata("suspendConversionOnArbitraryExpression.kt") public void testSuspendConversionOnArbitraryExpression() throws Exception { runTest("compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt"); } + @Test @TestMetadata("temporaryInEnumEntryInitializer.kt") public void testTemporaryInEnumEntryInitializer() throws Exception { runTest("compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt"); } + @Test @TestMetadata("temporaryInInitBlock.kt") public void testTemporaryInInitBlock() throws Exception { runTest("compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt"); } + @Test @TestMetadata("thisOfGenericOuterClass.kt") public void testThisOfGenericOuterClass() throws Exception { runTest("compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt"); } + @Test @TestMetadata("thisRefToObjectInNestedClassConstructorCall.kt") public void testThisRefToObjectInNestedClassConstructorCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.kt"); } + @Test @TestMetadata("thisReferenceBeforeClassDeclared.kt") public void testThisReferenceBeforeClassDeclared() throws Exception { runTest("compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt"); } + @Test @TestMetadata("throw.kt") public void testThrow() throws Exception { runTest("compiler/testData/ir/irText/expressions/throw.kt"); } + @Test @TestMetadata("tryCatch.kt") public void testTryCatch() throws Exception { runTest("compiler/testData/ir/irText/expressions/tryCatch.kt"); } + @Test @TestMetadata("tryCatchWithImplicitCast.kt") public void testTryCatchWithImplicitCast() throws Exception { runTest("compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.kt"); } + @Test @TestMetadata("typeAliasConstructorReference.kt") public void testTypeAliasConstructorReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt"); } + @Test @TestMetadata("typeArguments.kt") public void testTypeArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/typeArguments.kt"); } + @Test @TestMetadata("typeOperators.kt") public void testTypeOperators() throws Exception { runTest("compiler/testData/ir/irText/expressions/typeOperators.kt"); } + @Test @TestMetadata("typeParameterClassLiteral.kt") public void testTypeParameterClassLiteral() throws Exception { runTest("compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt"); } + @Test @TestMetadata("unsignedIntegerLiterals.kt") public void testUnsignedIntegerLiterals() throws Exception { runTest("compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.kt"); } + @Test @TestMetadata("useImportedMember.kt") public void testUseImportedMember() throws Exception { runTest("compiler/testData/ir/irText/expressions/useImportedMember.kt"); } + @Test @TestMetadata("values.kt") public void testValues() throws Exception { runTest("compiler/testData/ir/irText/expressions/values.kt"); } + @Test @TestMetadata("vararg.kt") public void testVararg() throws Exception { runTest("compiler/testData/ir/irText/expressions/vararg.kt"); } + @Test @TestMetadata("varargWithImplicitCast.kt") public void testVarargWithImplicitCast() throws Exception { runTest("compiler/testData/ir/irText/expressions/varargWithImplicitCast.kt"); } + @Test @TestMetadata("variableAsFunctionCall.kt") public void testVariableAsFunctionCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/variableAsFunctionCall.kt"); } + @Test @TestMetadata("variableAsFunctionCallWithGenerics.kt") public void testVariableAsFunctionCallWithGenerics() throws Exception { runTest("compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/ir/irText/expressions/when.kt"); } + @Test @TestMetadata("whenCoercedToUnit.kt") public void testWhenCoercedToUnit() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenCoercedToUnit.kt"); } + @Test @TestMetadata("whenElse.kt") public void testWhenElse() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenElse.kt"); } + @Test @TestMetadata("whenReturn.kt") public void testWhenReturn() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenReturn.kt"); } + @Test @TestMetadata("whenReturnUnit.kt") public void testWhenReturnUnit() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenReturnUnit.kt"); } + @Test @TestMetadata("whenSmartCastToEnum.kt") public void testWhenSmartCastToEnum() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt"); } + @Test @TestMetadata("whenUnusedExpression.kt") public void testWhenUnusedExpression() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenUnusedExpression.kt"); } + @Test @TestMetadata("whenWithSubjectVariable.kt") public void testWhenWithSubjectVariable() throws Exception { runTest("compiler/testData/ir/irText/expressions/whenWithSubjectVariable.kt"); } + @Test @TestMetadata("whileDoWhile.kt") public void testWhileDoWhile() throws Exception { runTest("compiler/testData/ir/irText/expressions/whileDoWhile.kt"); } + @Nested @TestMetadata("compiler/testData/ir/irText/expressions/callableReferences") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CallableReferences extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class CallableReferences extends AbstractFir2IrTextTest { + @Test @TestMetadata("adaptedExtensionFunctions.kt") public void testAdaptedExtensionFunctions() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.kt"); } + @Test @TestMetadata("adaptedWithCoercionToUnit.kt") public void testAdaptedWithCoercionToUnit() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.kt"); } + @Test public void testAllFilesPresentInCallableReferences() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/callableReferences"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/callableReferences"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boundInlineAdaptedReference.kt") public void testBoundInlineAdaptedReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt"); } + @Test @TestMetadata("boundInnerGenericConstructor.kt") public void testBoundInnerGenericConstructor() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt"); } + @Test @TestMetadata("caoWithAdaptationForSam.kt") public void testCaoWithAdaptationForSam() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.kt"); } + @Test @TestMetadata("constructorWithAdaptedArguments.kt") public void testConstructorWithAdaptedArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt"); } + @Test @TestMetadata("funWithDefaultParametersAsKCallableStar.kt") public void testFunWithDefaultParametersAsKCallableStar() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.kt"); } + @Test @TestMetadata("genericLocalClassConstructorReference.kt") public void testGenericLocalClassConstructorReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt"); } + @Test @TestMetadata("genericMember.kt") public void testGenericMember() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt"); } + @Test @TestMetadata("importedFromObject.kt") public void testImportedFromObject() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt"); } + @Test @TestMetadata("kt37131.kt") public void testKt37131() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/kt37131.kt"); } + @Test @TestMetadata("suspendConversion.kt") public void testSuspendConversion() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt"); } + @Test @TestMetadata("typeArguments.kt") public void testTypeArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt"); } + @Test @TestMetadata("unboundMemberReferenceWithAdaptedArguments.kt") public void testUnboundMemberReferenceWithAdaptedArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.kt"); } + @Test @TestMetadata("withAdaptationForSam.kt") public void testWithAdaptationForSam() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.kt"); } + @Test @TestMetadata("withAdaptedArguments.kt") public void testWithAdaptedArguments() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.kt"); } + @Test @TestMetadata("withArgumentAdaptationAndReceiver.kt") public void testWithArgumentAdaptationAndReceiver() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt"); } + @Test @TestMetadata("withVarargViewedAsArray.kt") public void testWithVarargViewedAsArray() throws Exception { runTest("compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/expressions/floatingPointComparisons") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FloatingPointComparisons extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class FloatingPointComparisons extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInFloatingPointComparisons() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/floatingPointComparisons"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/floatingPointComparisons"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("comparableWithDoubleOrFloat.kt") public void testComparableWithDoubleOrFloat() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.kt"); } + @Test @TestMetadata("eqeqRhsConditionPossiblyAffectingLhs.kt") public void testEqeqRhsConditionPossiblyAffectingLhs() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.kt"); } + @Test @TestMetadata("floatingPointCompareTo.kt") public void testFloatingPointCompareTo() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt"); } + @Test @TestMetadata("floatingPointEqeq.kt") public void testFloatingPointEqeq() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt"); } + @Test @TestMetadata("floatingPointEquals.kt") public void testFloatingPointEquals() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.kt"); } + @Test @TestMetadata("floatingPointExcleq.kt") public void testFloatingPointExcleq() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt"); } + @Test @TestMetadata("floatingPointLess.kt") public void testFloatingPointLess() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.kt"); } + @Test @TestMetadata("nullableAnyAsIntToDouble.kt") public void testNullableAnyAsIntToDouble() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.kt"); } + @Test @TestMetadata("nullableFloatingPointEqeq.kt") public void testNullableFloatingPointEqeq() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.kt"); } + @Test @TestMetadata("typeParameterWithPrimitiveNumericSupertype.kt") public void testTypeParameterWithPrimitiveNumericSupertype() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.kt"); } + @Test @TestMetadata("whenByFloatingPoint.kt") public void testWhenByFloatingPoint() throws Exception { runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/expressions/funInterface") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FunInterface extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class FunInterface extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInFunInterface() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("arrayAsVarargAfterSamArgument_fi.kt") public void testArrayAsVarargAfterSamArgument_fi() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.kt"); } + @Test @TestMetadata("basicFunInterfaceConversion.kt") public void testBasicFunInterfaceConversion() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt"); } + @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/castFromAny.kt"); } + @Test @TestMetadata("partialSam.kt") public void testPartialSam() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/partialSam.kt"); } + @Test @TestMetadata("samConversionInVarargs.kt") public void testSamConversionInVarargs() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.kt"); } + @Test @TestMetadata("samConversionInVarargsMixed.kt") public void testSamConversionInVarargsMixed() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.kt"); } + @Test @TestMetadata("samConversionOnCallableReference.kt") public void testSamConversionOnCallableReference() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt"); } + @Test @TestMetadata("samConversionsWithSmartCasts.kt") public void testSamConversionsWithSmartCasts() throws Exception { runTest("compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/expressions/sam") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Sam extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Sam extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInSam() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/sam"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/expressions/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("arrayAsVarargAfterSamArgument.kt") public void testArrayAsVarargAfterSamArgument() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt"); } + @Test @TestMetadata("genericSamProjectedOut.kt") public void testGenericSamProjectedOut() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.kt"); } + @Test @TestMetadata("genericSamSmartcast.kt") public void testGenericSamSmartcast() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/genericSamSmartcast.kt"); } + @Test @TestMetadata("samByProjectedType.kt") public void testSamByProjectedType() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samByProjectedType.kt"); } + @Test @TestMetadata("samConstructors.kt") public void testSamConstructors() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samConstructors.kt"); } + @Test @TestMetadata("samConversionInGenericConstructorCall.kt") public void testSamConversionInGenericConstructorCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt"); } + @Test @TestMetadata("samConversionInGenericConstructorCall_NI.kt") public void testSamConversionInGenericConstructorCall_NI() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.kt"); } + @Test @TestMetadata("samConversionToGeneric.kt") public void testSamConversionToGeneric() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt"); } + @Test @TestMetadata("samConversions.kt") public void testSamConversions() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samConversions.kt"); } + @Test @TestMetadata("samConversionsWithSmartCasts.kt") public void testSamConversionsWithSmartCasts() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt"); } + @Test @TestMetadata("samOperators.kt") public void testSamOperators() throws Exception { runTest("compiler/testData/ir/irText/expressions/sam/samOperators.kt"); @@ -1771,251 +2047,279 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { } } + @Nested @TestMetadata("compiler/testData/ir/irText/firProblems") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FirProblems extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class FirProblems extends AbstractFir2IrTextTest { + @Test @TestMetadata("AbstractMutableMap.kt") public void testAbstractMutableMap() throws Exception { runTest("compiler/testData/ir/irText/firProblems/AbstractMutableMap.kt"); } + @Test @TestMetadata("AllCandidates.kt") public void testAllCandidates() throws Exception { runTest("compiler/testData/ir/irText/firProblems/AllCandidates.kt"); } + @Test public void testAllFilesPresentInFirProblems() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/firProblems"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/firProblems"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("AnnotationInAnnotation.kt") public void testAnnotationInAnnotation() throws Exception { runTest("compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.kt"); } + @Test @TestMetadata("candidateSymbol.kt") public void testCandidateSymbol() throws Exception { runTest("compiler/testData/ir/irText/firProblems/candidateSymbol.kt"); } + @Test @TestMetadata("ClashResolutionDescriptor.kt") public void testClashResolutionDescriptor() throws Exception { runTest("compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt"); } + @Test @TestMetadata("coercionToUnitForNestedWhen.kt") public void testCoercionToUnitForNestedWhen() throws Exception { runTest("compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt"); } + @Test @TestMetadata("DeepCopyIrTree.kt") public void testDeepCopyIrTree() throws Exception { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test @TestMetadata("DelegationAndInheritanceFromJava.kt") public void testDelegationAndInheritanceFromJava() throws Exception { runTest("compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt"); } + @Test @TestMetadata("deprecated.kt") public void testDeprecated() throws Exception { runTest("compiler/testData/ir/irText/firProblems/deprecated.kt"); } + @Test @TestMetadata("FirBuilder.kt") public void testFirBuilder() throws Exception { runTest("compiler/testData/ir/irText/firProblems/FirBuilder.kt"); } + @Test @TestMetadata("ImplicitReceiverStack.kt") public void testImplicitReceiverStack() throws Exception { runTest("compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt"); } + @Test @TestMetadata("inapplicableCollectionSet.kt") public void testInapplicableCollectionSet() throws Exception { runTest("compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.kt"); } + @Test @TestMetadata("InnerClassInAnonymous.kt") public void testInnerClassInAnonymous() throws Exception { runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test @TestMetadata("kt43342.kt") public void testKt43342() throws Exception { runTest("compiler/testData/ir/irText/firProblems/kt43342.kt"); } + @Test @TestMetadata("MultiList.kt") public void testMultiList() throws Exception { runTest("compiler/testData/ir/irText/firProblems/MultiList.kt"); } + @Test @TestMetadata("putIfAbsent.kt") public void testPutIfAbsent() throws Exception { runTest("compiler/testData/ir/irText/firProblems/putIfAbsent.kt"); } + @Test @TestMetadata("readWriteProperty.kt") public void testReadWriteProperty() throws Exception { runTest("compiler/testData/ir/irText/firProblems/readWriteProperty.kt"); } + @Test @TestMetadata("recursiveCapturedTypeInPropertyReference.kt") public void testRecursiveCapturedTypeInPropertyReference() throws Exception { runTest("compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.kt"); } + @Test @TestMetadata("SameJavaFieldReferences.kt") public void testSameJavaFieldReferences() throws Exception { runTest("compiler/testData/ir/irText/firProblems/SameJavaFieldReferences.kt"); } + @Test @TestMetadata("SignatureClash.kt") public void testSignatureClash() throws Exception { runTest("compiler/testData/ir/irText/firProblems/SignatureClash.kt"); } + @Test @TestMetadata("SyntheticSetterType.kt") public void testSyntheticSetterType() throws Exception { runTest("compiler/testData/ir/irText/firProblems/SyntheticSetterType.kt"); } + @Test @TestMetadata("throwableStackTrace.kt") public void testThrowableStackTrace() throws Exception { runTest("compiler/testData/ir/irText/firProblems/throwableStackTrace.kt"); } + @Test @TestMetadata("typeParameterFromJavaClass.kt") public void testTypeParameterFromJavaClass() throws Exception { runTest("compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.kt"); } + @Test @TestMetadata("typeVariableAfterBuildMap.kt") public void testTypeVariableAfterBuildMap() throws Exception { runTest("compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt"); } + @Test @TestMetadata("V8ArrayToList.kt") public void testV8ArrayToList() throws Exception { runTest("compiler/testData/ir/irText/firProblems/V8ArrayToList.kt"); } + @Test @TestMetadata("VarInInit.kt") public void testVarInInit() throws Exception { runTest("compiler/testData/ir/irText/firProblems/VarInInit.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/lambdas") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Lambdas extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Lambdas extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInLambdas() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("anonymousFunction.kt") public void testAnonymousFunction() throws Exception { runTest("compiler/testData/ir/irText/lambdas/anonymousFunction.kt"); } + @Test @TestMetadata("destructuringInLambda.kt") public void testDestructuringInLambda() throws Exception { runTest("compiler/testData/ir/irText/lambdas/destructuringInLambda.kt"); } + @Test @TestMetadata("extensionLambda.kt") public void testExtensionLambda() throws Exception { runTest("compiler/testData/ir/irText/lambdas/extensionLambda.kt"); } + @Test @TestMetadata("justLambda.kt") public void testJustLambda() throws Exception { runTest("compiler/testData/ir/irText/lambdas/justLambda.kt"); } + @Test @TestMetadata("localFunction.kt") public void testLocalFunction() throws Exception { runTest("compiler/testData/ir/irText/lambdas/localFunction.kt"); } + @Test @TestMetadata("multipleImplicitReceivers.kt") public void testMultipleImplicitReceivers() throws Exception { runTest("compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt"); } + @Test @TestMetadata("nonLocalReturn.kt") public void testNonLocalReturn() throws Exception { runTest("compiler/testData/ir/irText/lambdas/nonLocalReturn.kt"); } + @Test @TestMetadata("samAdapter.kt") public void testSamAdapter() throws Exception { runTest("compiler/testData/ir/irText/lambdas/samAdapter.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/regressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Regressions extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Regressions extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInRegressions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("coercionInLoop.kt") public void testCoercionInLoop() throws Exception { runTest("compiler/testData/ir/irText/regressions/coercionInLoop.kt"); } + @Test @TestMetadata("integerCoercionToT.kt") public void testIntegerCoercionToT() throws Exception { runTest("compiler/testData/ir/irText/regressions/integerCoercionToT.kt"); } + @Test @TestMetadata("kt24114.kt") public void testKt24114() throws Exception { runTest("compiler/testData/ir/irText/regressions/kt24114.kt"); } + @Test @TestMetadata("typeAliasCtorForGenericClass.kt") public void testTypeAliasCtorForGenericClass() throws Exception { runTest("compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt"); } + @Test @TestMetadata("typeParametersInImplicitCast.kt") public void testTypeParametersInImplicitCast() throws Exception { runTest("compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt"); } + @Nested @TestMetadata("compiler/testData/ir/irText/regressions/newInference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NewInference extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class NewInference extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInNewInference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions/newInference"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/regressions/newInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("fixationOrder1.kt") public void testFixationOrder1() throws Exception { runTest("compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt"); @@ -2023,348 +2327,390 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { } } + @Nested @TestMetadata("compiler/testData/ir/irText/singletons") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Singletons extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Singletons extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInSingletons() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/singletons"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/singletons"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("companion.kt") public void testCompanion() throws Exception { runTest("compiler/testData/ir/irText/singletons/companion.kt"); } + @Test @TestMetadata("enumEntry.kt") public void testEnumEntry() throws Exception { runTest("compiler/testData/ir/irText/singletons/enumEntry.kt"); } + @Test @TestMetadata("object.kt") public void testObject() throws Exception { runTest("compiler/testData/ir/irText/singletons/object.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/stubs") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Stubs extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Stubs extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInStubs() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/stubs"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/stubs"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("builtinMap.kt") public void testBuiltinMap() throws Exception { runTest("compiler/testData/ir/irText/stubs/builtinMap.kt"); } + @Test @TestMetadata("constFromBuiltins.kt") public void testConstFromBuiltins() throws Exception { runTest("compiler/testData/ir/irText/stubs/constFromBuiltins.kt"); } + @Test @TestMetadata("genericClassInDifferentModule.kt") public void testGenericClassInDifferentModule() throws Exception { runTest("compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt"); } + @Test @TestMetadata("javaConstructorWithTypeParameters.kt") public void testJavaConstructorWithTypeParameters() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.kt"); } + @Test @TestMetadata("javaEnum.kt") public void testJavaEnum() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaEnum.kt"); } + @Test @TestMetadata("javaInnerClass.kt") public void testJavaInnerClass() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaInnerClass.kt"); } + @Test @TestMetadata("javaMethod.kt") public void testJavaMethod() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaMethod.kt"); } + @Test @TestMetadata("javaNestedClass.kt") public void testJavaNestedClass() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaNestedClass.kt"); } + @Test @TestMetadata("javaStaticMethod.kt") public void testJavaStaticMethod() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaStaticMethod.kt"); } + @Test @TestMetadata("javaSyntheticProperty.kt") public void testJavaSyntheticProperty() throws Exception { runTest("compiler/testData/ir/irText/stubs/javaSyntheticProperty.kt"); } + @Test @TestMetadata("jdkClassSyntheticProperty.kt") public void testJdkClassSyntheticProperty() throws Exception { runTest("compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.kt"); } + @Test @TestMetadata("kotlinInnerClass.kt") public void testKotlinInnerClass() throws Exception { runTest("compiler/testData/ir/irText/stubs/kotlinInnerClass.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/ir/irText/stubs/simple.kt"); } } + @Nested @TestMetadata("compiler/testData/ir/irText/types") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Types extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Types extends AbstractFir2IrTextTest { + @Test @TestMetadata("abbreviatedTypes.kt") public void testAbbreviatedTypes() throws Exception { runTest("compiler/testData/ir/irText/types/abbreviatedTypes.kt"); } + @Test public void testAllFilesPresentInTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("asOnPlatformType.kt") public void testAsOnPlatformType() throws Exception { runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt"); } + @Test @TestMetadata("castsInsideCoroutineInference.kt") public void testCastsInsideCoroutineInference() throws Exception { runTest("compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt"); } + @Test @TestMetadata("coercionToUnitInLambdaReturnValue.kt") public void testCoercionToUnitInLambdaReturnValue() throws Exception { runTest("compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt"); } + @Test @TestMetadata("genericDelegatedDeepProperty.kt") public void testGenericDelegatedDeepProperty() throws Exception { runTest("compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt"); } + @Test @TestMetadata("genericFunWithStar.kt") public void testGenericFunWithStar() throws Exception { runTest("compiler/testData/ir/irText/types/genericFunWithStar.kt"); } + @Test @TestMetadata("genericPropertyReferenceType.kt") public void testGenericPropertyReferenceType() throws Exception { runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt"); } + @Test @TestMetadata("inStarProjectionInReceiverType.kt") public void testInStarProjectionInReceiverType() throws Exception { runTest("compiler/testData/ir/irText/types/inStarProjectionInReceiverType.kt"); } + @Test @TestMetadata("intersectionType1_NI.kt") public void testIntersectionType1_NI() throws Exception { runTest("compiler/testData/ir/irText/types/intersectionType1_NI.kt"); } + @Test @TestMetadata("intersectionType1_OI.kt") public void testIntersectionType1_OI() throws Exception { runTest("compiler/testData/ir/irText/types/intersectionType1_OI.kt"); } + @Test @TestMetadata("intersectionType2_NI.kt") public void testIntersectionType2_NI() throws Exception { runTest("compiler/testData/ir/irText/types/intersectionType2_NI.kt"); } + @Test @TestMetadata("intersectionType2_OI.kt") public void testIntersectionType2_OI() throws Exception { runTest("compiler/testData/ir/irText/types/intersectionType2_OI.kt"); } + @Test @TestMetadata("intersectionType3_NI.kt") public void testIntersectionType3_NI() throws Exception { runTest("compiler/testData/ir/irText/types/intersectionType3_NI.kt"); } + @Test @TestMetadata("intersectionType3_OI.kt") public void testIntersectionType3_OI() throws Exception { runTest("compiler/testData/ir/irText/types/intersectionType3_OI.kt"); } + @Test @TestMetadata("javaWildcardType.kt") public void testJavaWildcardType() throws Exception { runTest("compiler/testData/ir/irText/types/javaWildcardType.kt"); } + @Test @TestMetadata("kt36143.kt") public void testKt36143() throws Exception { runTest("compiler/testData/ir/irText/types/kt36143.kt"); } + @Test @TestMetadata("localVariableOfIntersectionType_NI.kt") public void testLocalVariableOfIntersectionType_NI() throws Exception { runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt"); } + @Test @TestMetadata("rawTypeInSignature.kt") public void testRawTypeInSignature() throws Exception { runTest("compiler/testData/ir/irText/types/rawTypeInSignature.kt"); } + @Test @TestMetadata("receiverOfIntersectionType.kt") public void testReceiverOfIntersectionType() throws Exception { runTest("compiler/testData/ir/irText/types/receiverOfIntersectionType.kt"); } + @Test @TestMetadata("smartCastOnFakeOverrideReceiver.kt") public void testSmartCastOnFakeOverrideReceiver() throws Exception { runTest("compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt"); } + @Test @TestMetadata("smartCastOnFieldReceiverOfGenericType.kt") public void testSmartCastOnFieldReceiverOfGenericType() throws Exception { runTest("compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.kt"); } + @Test @TestMetadata("smartCastOnReceiverOfGenericType.kt") public void testSmartCastOnReceiverOfGenericType() throws Exception { runTest("compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt"); } + @Test @TestMetadata("starProjection_OI.kt") public void testStarProjection_OI() throws Exception { runTest("compiler/testData/ir/irText/types/starProjection_OI.kt"); } + @Test @TestMetadata("typeAliasWithUnsafeVariance.kt") public void testTypeAliasWithUnsafeVariance() throws Exception { runTest("compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt"); } + @Nested @TestMetadata("compiler/testData/ir/irText/types/nullChecks") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullChecks extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class NullChecks extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInNullChecks() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("enhancedNullability.kt") public void testEnhancedNullability() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt"); } + @Test @TestMetadata("enhancedNullabilityInDestructuringAssignment.kt") public void testEnhancedNullabilityInDestructuringAssignment() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt"); } + @Test @TestMetadata("enhancedNullabilityInForLoop.kt") public void testEnhancedNullabilityInForLoop() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt"); } + @Test @TestMetadata("explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt") public void testExplicitEqualsAndCompareToCallsOnPlatformTypeReceiver() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt"); } + @Test @TestMetadata("implicitNotNullOnPlatformType.kt") public void testImplicitNotNullOnPlatformType() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt"); } + @Test @TestMetadata("nullabilityAssertionOnExtensionReceiver.kt") public void testNullabilityAssertionOnExtensionReceiver() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt"); } + @Test @TestMetadata("platformTypeReceiver.kt") public void testPlatformTypeReceiver() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.kt"); } + @Nested @TestMetadata("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullCheckOnLambdaResult extends AbstractFir2IrTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class NullCheckOnLambdaResult extends AbstractFir2IrTextTest { + @Test public void testAllFilesPresentInNullCheckOnLambdaResult() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("nnStringVsT.kt") public void testNnStringVsT() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt"); } + @Test @TestMetadata("nnStringVsTAny.kt") public void testNnStringVsTAny() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt"); } + @Test @TestMetadata("nnStringVsTConstrained.kt") public void testNnStringVsTConstrained() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt"); } + @Test @TestMetadata("nnStringVsTXArray.kt") public void testNnStringVsTXArray() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt"); } + @Test @TestMetadata("nnStringVsTXString.kt") public void testNnStringVsTXString() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt"); } + @Test @TestMetadata("stringVsT.kt") public void testStringVsT() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt"); } + @Test @TestMetadata("stringVsTAny.kt") public void testStringVsTAny() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt"); } + @Test @TestMetadata("stringVsTConstrained.kt") public void testStringVsTConstrained() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt"); } + @Test @TestMetadata("stringVsTXArray.kt") public void testStringVsTXArray() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt"); } + @Test @TestMetadata("stringVsTXString.kt") public void testStringVsTXString() throws Exception { runTest("compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt"); diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt deleted file mode 100644 index 15714781e03..00000000000 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * 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.fir - -import com.intellij.openapi.project.Project -import com.intellij.psi.PsiElementFinder -import com.intellij.psi.search.GlobalSearchScope -import org.jetbrains.kotlin.asJava.finder.JavaElementFinder -import org.jetbrains.kotlin.backend.jvm.JvmGeneratorExtensions -import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM -import org.jetbrains.kotlin.config.languageVersionSettings -import org.jetbrains.kotlin.fir.analysis.FirAnalyzerFacade -import org.jetbrains.kotlin.ir.AbstractIrTextTestCase -import org.jetbrains.kotlin.ir.declarations.IrModuleFragment -import java.io.File - -abstract class AbstractFir2IrTextTest : AbstractIrTextTestCase() { - - private fun prepareProjectExtensions(project: Project) { - PsiElementFinder.EP.getPoint(project).unregisterExtension(JavaElementFinder::class.java) - } - - override fun doTest(wholeFile: File, testFiles: List) { - buildFragmentAndTestIt(wholeFile, testFiles) - } - - override fun doTest(filePath: String) { - val oldFrontendTextPath = filePath.replace(".kt", ".txt") - val firTextPath = filePath.replace(".kt", ".fir.txt") - val oldFrontendTextFile = File(oldFrontendTextPath) - val firTextFile = File(firTextPath) - if (oldFrontendTextFile.exists() && firTextFile.exists()) { - compareAndMergeFirFileAndOldFrontendFile(oldFrontendTextFile, firTextFile, compareWithTrimming = true) - } - super.doTest(filePath) - } - - override fun getExpectedTextFileName(testFile: TestFile, name: String): String { - // NB: replace with if (true) to make test against old FE results - if ("// FIR_IDENTICAL" in testFile.content.split("\n")) { - return super.getExpectedTextFileName(testFile, name) - } - return name.replace(".txt", ".fir.txt").replace(".kt", ".fir.txt") - } - - override fun generateIrModule(ignoreErrors: Boolean): IrModuleFragment { - val psiFiles = myFiles.psiFiles - - val project = psiFiles.first().project - prepareProjectExtensions(project) - - val scope = GlobalSearchScope.filesScope(project, psiFiles.map { it.virtualFile }) - .uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(project)) - val session = createSession(myEnvironment, scope) - val firAnalyzerFacade = FirAnalyzerFacade(session, myEnvironment.configuration.languageVersionSettings, psiFiles) - return firAnalyzerFacade.convertToIr(JvmGeneratorExtensions(generateFacades = false)).irModuleFragment - } -} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt new file mode 100644 index 00000000000..23e719d6ca7 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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.test.backend.handlers + +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.FIR_IDENTICAL +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer +import org.jetbrains.kotlin.test.model.AfterAnalysisChecker +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.moduleStructure +import org.jetbrains.kotlin.test.utils.FirIdenticalCheckerHelper +import org.jetbrains.kotlin.test.utils.withExtension +import java.io.File + +class FirIrDumpIdenticalChecker(testServices: TestServices) : AfterAnalysisChecker(testServices) { + override val directives: List + get() = listOf(FirDiagnosticsDirectives) + + private val simpleDumpChecker = object : FirIdenticalCheckerHelper(testServices) { + override fun getClassicFileToCompare(testDataFile: File): File? { + return testDataFile.withExtension(IrTextDumpHandler.DUMP_EXTENSION).takeIf { it.exists() } + } + + override fun getFirFileToCompare(testDataFile: File): File? { + return testDataFile.withExtension("fir.${IrTextDumpHandler.DUMP_EXTENSION}").takeIf { it.exists() } + } + } + + private val prettyDumpChecker = object : FirIdenticalCheckerHelper(testServices) { + override fun getClassicFileToCompare(testDataFile: File): File? { + return testDataFile.withExtension(IrPrettyKotlinDumpHandler.DUMP_EXTENSION).takeIf { it.exists() } + } + + override fun getFirFileToCompare(testDataFile: File): File? { + return testDataFile.withExtension("fir.${IrPrettyKotlinDumpHandler.DUMP_EXTENSION}").takeIf { it.exists() } + } + } + + override fun check(failedAssertions: List) { + if (failedAssertions.isNotEmpty()) return + val testDataFile = testServices.moduleStructure.originalTestDataFiles.first() + if (FIR_IDENTICAL in testServices.moduleStructure.allDirectives) { + simpleDumpChecker.deleteFirFile(testDataFile) + prettyDumpChecker.deleteFirFile(testDataFile) + return + } + if ( + simpleDumpChecker.firAndClassicContentsAreEquals(testDataFile) && + prettyDumpChecker.firAndClassicContentsAreEquals(testDataFile, trimLines = true) + ) { + simpleDumpChecker.deleteFirFile(testDataFile) + prettyDumpChecker.deleteFirFile(testDataFile) + simpleDumpChecker.addDirectiveToClassicFileAndAssert(testDataFile) + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt index 9cf9e7fe0c9..115856f3a3b 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt @@ -11,9 +11,12 @@ import org.jetbrains.kotlin.ir.util.dumpKotlinLike import org.jetbrains.kotlin.test.backend.handlers.IrTextDumpHandler.Companion.computeDumpExtension import org.jetbrains.kotlin.test.backend.handlers.IrTextDumpHandler.Companion.groupWithTestFiles import org.jetbrains.kotlin.test.backend.ir.IrBackendInput +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_KT_IR import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.EXTERNAL_FILE import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.SKIP_KT_DUMP +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.TestServices import org.jetbrains.kotlin.test.services.moduleStructure @@ -21,8 +24,15 @@ import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumperImpl import org.jetbrains.kotlin.test.utils.withExtension class IrPrettyKotlinDumpHandler(testServices: TestServices) : AbstractIrHandler(testServices) { + companion object { + const val DUMP_EXTENSION = "kt.txt" + } + private val dumper = MultiModuleInfoDumperImpl("// MODULE: %s") + override val directivesContainers: List + get() = listOf(CodegenTestDirectives, FirDiagnosticsDirectives) + override fun processModule(module: TestModule, info: IrBackendInput) { if (DUMP_KT_IR !in module.directives || SKIP_KT_DUMP in module.directives) return @@ -47,7 +57,7 @@ class IrPrettyKotlinDumpHandler(testServices: TestServices) : AbstractIrHandler( override fun processAfterAllModules(someAssertionWasFailed: Boolean) { if (dumper.isEmpty()) return val moduleStructure = testServices.moduleStructure - val extension = computeDumpExtension(moduleStructure.modules.first(), "kt.txt") + val extension = computeDumpExtension(moduleStructure.modules.first(), DUMP_EXTENSION) val expectedFile = moduleStructure.originalTestDataFiles.first().withExtension(extension) assertions.assertEqualsToFile(expectedFile, dumper.generateResultingDump()) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt index 964cd62f34e..205c682b4d8 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrTextDumpHandler.kt @@ -36,6 +36,8 @@ import java.io.File class IrTextDumpHandler(testServices: TestServices) : AbstractIrHandler(testServices) { companion object { + const val DUMP_EXTENSION = "txt" + fun computeDumpExtension(module: TestModule, defaultExtension: String): String { return if (module.frontendKind == FrontendKinds.ClassicFrontend || FIR_IDENTICAL in module.directives) defaultExtension else "fir.$defaultExtension" @@ -74,6 +76,9 @@ class IrTextDumpHandler(testServices: TestServices) : AbstractIrHandler(testServ } private fun compareDumpsOfExternalClasses(module: TestModule, info: IrBackendInput) { + // FIR doesn't support searching descriptors + if (module.frontendKind == FrontendKinds.FIR) return + val externalClassFqns = module.directives[DUMP_EXTERNAL_CLASS] if (externalClassFqns.isEmpty()) return @@ -121,5 +126,5 @@ class IrTextDumpHandler(testServices: TestServices) : AbstractIrHandler(testServ } private val TestModule.dumpExtension: String - get() = computeDumpExtension(this, "txt") + get() = computeDumpExtension(this, DUMP_EXTENSION) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt index 1416eaedd9f..d080ddbef6f 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt @@ -5,49 +5,43 @@ package org.jetbrains.kotlin.test.frontend.fir.handlers -import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives import org.jetbrains.kotlin.test.model.AfterAnalysisChecker import org.jetbrains.kotlin.test.services.TestServices -import org.jetbrains.kotlin.test.services.assertions import org.jetbrains.kotlin.test.services.moduleStructure +import org.jetbrains.kotlin.test.utils.FirIdenticalCheckerHelper import org.jetbrains.kotlin.test.utils.firTestDataFile import org.jetbrains.kotlin.test.utils.isFirTestData import org.jetbrains.kotlin.test.utils.originalTestDataFile import java.io.File class FirIdenticalChecker(testServices: TestServices) : AfterAnalysisChecker(testServices) { + private val helper = object : FirIdenticalCheckerHelper(testServices) { + override fun getClassicFileToCompare(testDataFile: File): File { + return if (testDataFile.isFirTestData) testDataFile.originalTestDataFile else testDataFile + } + + override fun getFirFileToCompare(testDataFile: File): File { + return if (testDataFile.isFirTestData) testDataFile else testDataFile.firTestDataFile + } + } + override fun check(failedAssertions: List) { if (failedAssertions.isNotEmpty()) return - val file = testServices.moduleStructure.originalTestDataFiles.first() - if (file.isFirTestData) { - addDirectiveToClassicFile(file) + val testDataFile = testServices.moduleStructure.originalTestDataFiles.first() + if (testDataFile.isFirTestData) { + val firFile = helper.getFirFileToCompare(testDataFile) + val classicFile = helper.getClassicFileToCompare(testDataFile) + if (helper.contentsAreEquals(classicFile, firFile)) { + helper.deleteFirFile(testDataFile) + helper.addDirectiveToClassicFileAndAssert(testDataFile) + } } else { - removeFirFileIfExist(file) + removeFirFileIfExist(testDataFile) } } - private fun addDirectiveToClassicFile(firFile: File) { - val classicFile = firFile.originalTestDataFile - val classicFileContent = classicFile.readText() - val firFileContent = firFile.readText() - if (classicFileContent == firFileContent) { - classicFile.writer().use { - it.appendLine("// ${FirDiagnosticsDirectives.FIR_IDENTICAL.name}") - it.append(classicFileContent) - } - firFile.delete() - testServices.assertions.fail { - """ - Dumps via FIR & via old FE are the same. - Deleted .fir.txt dump, added // FIR_IDENTICAL to test source - Please re-run the test now - """.trimIndent() - } - } - } - - private fun removeFirFileIfExist(classicFile: File) { - val firFile = classicFile.firTestDataFile + private fun removeFirFileIfExist(testDataFile: File) { + val firFile = helper.getFirFileToCompare(testDataFile) firFile.delete() } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt index ffdd84a09d2..410ff9b9c40 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt @@ -7,9 +7,9 @@ package org.jetbrains.kotlin.test.runners.ir import org.jetbrains.kotlin.platform.jvm.JvmPlatforms import org.jetbrains.kotlin.test.TargetBackend -import org.jetbrains.kotlin.test.backend.handlers.IrPrettyKotlinDumpHandler import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor import org.jetbrains.kotlin.test.backend.handlers.* +import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_IR import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_KT_IR @@ -70,3 +70,12 @@ abstract class AbstractIrTextTestBase( } open class AbstractIrTextTest : AbstractIrTextTestBase(FrontendKinds.ClassicFrontend) + +open class AbstractFir2IrTextTest : AbstractIrTextTestBase(FrontendKinds.FIR) { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + with(builder) { + useAfterAnalysisCheckers(::FirIrDumpIdenticalChecker) + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt new file mode 100644 index 00000000000..6f5e5cb8a5d --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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.test.utils + +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.assertions +import java.io.File + +abstract class FirIdenticalCheckerHelper(private val testServices: TestServices) { + abstract fun getClassicFileToCompare(testDataFile: File): File? + abstract fun getFirFileToCompare(testDataFile: File): File? + + fun firAndClassicContentsAreEquals(testDataFile: File, trimLines: Boolean = false): Boolean { + val classicFile = getClassicFileToCompare(testDataFile) ?: return true + val firFile = getFirFileToCompare(testDataFile) ?: return true + return contentsAreEquals(classicFile, firFile, trimLines) + } + + fun contentsAreEquals(classicFile: File, firFile: File, trimLines: Boolean = false): Boolean { + val classicFileContent = classicFile.readContent(trimLines) + val firFileContent = firFile.readContent(trimLines) + return classicFileContent == firFileContent + } + + private fun File.readContent(trimLines: Boolean): String { + return if (trimLines) { + this.readLines().map { it.trimEnd() }.joinToString("\n").trimEnd() + } else { + this.readText() + } + } + + fun addDirectiveToClassicFileAndAssert(testDataFile: File) { + val classicFileContent = testDataFile.readText() + testDataFile.writer().use { + it.appendLine("// ${FirDiagnosticsDirectives.FIR_IDENTICAL.name}") + it.append(classicFileContent) + } + testServices.assertions.fail { + """ + Dumps via FIR & via old FE are the same. + Deleted .fir.txt dump, added // FIR_IDENTICAL to test source + Please re-run the test now + """.trimIndent() + } + } + + fun deleteFirFile(testDataFile: File) { + getFirFileToCompare(testDataFile)?.takeIf { it.exists() }?.delete() + } +} diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt index 16d624c8299..762bc10c62f 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt @@ -597,16 +597,6 @@ fun generateJUnit3CompilerTests(args: Array) { } } - testGroup( - "compiler/fir/fir2ir/tests-gen", "compiler/testData", - testRunnerMethodName = "runTestWithCustomIgnoreDirective", - additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"") - ) { - testClass { - model("ir/irText") - } - } - testGroup("compiler/visualizer/tests-gen", "compiler/fir/raw-fir/psi2fir/testData") { testClass("PsiVisualizerForRawFirDataGenerated") { model("rawBuilder", testMethod = "doFirBuilderDataTest") diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index 26f4475dbf3..41409bd3563 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.test.runners.* import org.jetbrains.kotlin.test.runners.codegen.AbstractBlackBoxCodegenTest import org.jetbrains.kotlin.test.runners.codegen.AbstractFirBlackBoxCodegenTest import org.jetbrains.kotlin.test.runners.codegen.AbstractIrBlackBoxCodegenTest +import org.jetbrains.kotlin.test.runners.ir.AbstractFir2IrTextTest import org.jetbrains.kotlin.test.runners.ir.AbstractIrTextTest import org.junit.jupiter.api.parallel.Execution import org.junit.jupiter.api.parallel.ExecutionMode @@ -99,6 +100,11 @@ fun generateJUnit5CompilerTests(args: Array) { model("resolve", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME) } } - } + testGroup(testsRoot = "compiler/fir/analysis-tests/tests-gen", testDataRoot = "compiler/testData") { + testClass { + model("ir/irText") + } + } + } }