From 49d9b8595024d53cf7d0b8b08cce9dad01f9d457 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 15 Dec 2020 16:07:26 +0300 Subject: [PATCH] [TEST] Migrate AbstractFirDiagnosticsWithLightTreeTest to new test runners Also this commit adds AbstractTwoAttributesMetaInfoProcessor which can be used for reporting diagnostics with two attributes (OI/NI, PSI/Light tree) --- ...n.txt => recursiveNamedAnnotation.fir.txt} | 0 .../jetbrains/kotlin/test/model/Facades.kt | 4 + ...DiagnosticsWithLightTreeTestGenerated.java | 801 ++++++++++++------ .../directives/FirDiagnosticsDirectives.kt | 11 + .../handlers/ClassicDiagnosticReporter.kt | 64 +- .../test/frontend/fir/FirFrontendFacade.kt | 16 +- .../fir/handlers/FirDiagnosticsHandler.kt | 54 +- .../generators/GenerateNewCompilerTests.kt | 10 +- .../kotlin/test/impl/TestConfigurationImpl.kt | 7 +- .../test/runners/AbstractFirDiagnosticTest.kt | 22 +- .../AbstractTwoAttributesMetaInfoProcessor.kt | 76 ++ .../generators/tests/GenerateCompilerTests.kt | 5 - 12 files changed, 757 insertions(+), 313 deletions(-) rename compiler/fir/analysis-tests/testData/resolve/problems/{recursiveNamedAnnotation.txt => recursiveNamedAnnotation.fir.txt} (100%) rename compiler/{fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir => tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners}/FirDiagnosticsWithLightTreeTestGenerated.java (91%) create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/AbstractTwoAttributesMetaInfoProcessor.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.txt b/compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.fir.txt similarity index 100% rename from compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.txt rename to compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.fir.txt diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/Facades.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/Facades.kt index aafed38186b..d6f075f226b 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/Facades.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/Facades.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.test.model +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer import org.jetbrains.kotlin.test.services.ServiceRegistrationData import org.jetbrains.kotlin.test.services.TestServices @@ -16,6 +17,9 @@ abstract class AbstractTestFacade, O : ResultingArtifac open val additionalServices: List get() = emptyList() + + open val additionalDirectives: List + get() = emptyList() } abstract class FrontendFacade>( diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java similarity index 91% rename from compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java index 0c4b52b3e1a..95c5bdf1c1a 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java @@ -3,1681 +3,1940 @@ * 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; 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.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/fir/analysis-tests/testData/resolve") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + @Test public void testAllFilesPresentInResolve() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("asImports.kt") public void testAsImports() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/asImports.kt"); } + @Test @TestMetadata("bareTypes.kt") public void testBareTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/bareTypes.kt"); } + @Test @TestMetadata("cast.kt") public void testCast() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cast.kt"); } + @Test @TestMetadata("companion.kt") public void testCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt"); } + @Test @TestMetadata("companionAccessInEnum.kt") public void testCompanionAccessInEnum() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/companionAccessInEnum.kt"); } + @Test @TestMetadata("companionObjectCall.kt") public void testCompanionObjectCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt"); } + @Test @TestMetadata("companionUsesNested.kt") public void testCompanionUsesNested() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/companionUsesNested.kt"); } + @Test @TestMetadata("constantValues.kt") public void testConstantValues() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/constantValues.kt"); } + @Test @TestMetadata("copy.kt") public void testCopy() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/copy.kt"); } + @Test @TestMetadata("covariantArrayAsReceiver.kt") public void testCovariantArrayAsReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/covariantArrayAsReceiver.kt"); } + @Test @TestMetadata("defaultJavaImportHiding.kt") public void testDefaultJavaImportHiding() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/defaultJavaImportHiding.kt"); } + @Test @TestMetadata("defaultParametersInheritedToJava.kt") public void testDefaultParametersInheritedToJava() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/defaultParametersInheritedToJava.kt"); } + @Test @TestMetadata("definitelyNotNullAmbiguity.kt") public void testDefinitelyNotNullAmbiguity() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/definitelyNotNullAmbiguity.kt"); } + @Test @TestMetadata("delegatedSuperType.kt") public void testDelegatedSuperType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.kt"); } + @Test @TestMetadata("delegatingConstructorCall.kt") public void testDelegatingConstructorCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt"); } + @Test @TestMetadata("delegatingConstructorsAndTypeAliases.kt") public void testDelegatingConstructorsAndTypeAliases() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegatingConstructorsAndTypeAliases.kt"); } + @Test @TestMetadata("derivedClass.kt") public void testDerivedClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/derivedClass.kt"); } + @Test @TestMetadata("enum.kt") public void testEnum() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/enum.kt"); } + @Test @TestMetadata("enumWithCompanion.kt") public void testEnumWithCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/enumWithCompanion.kt"); } + @Test @TestMetadata("exhaustiveWhenAndDNNType.kt") public void testExhaustiveWhenAndDNNType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.kt"); } + @Test @TestMetadata("exhaustiveWhenAndFlexibleType.kt") public void testExhaustiveWhenAndFlexibleType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndFlexibleType.kt"); } + @Test @TestMetadata("exhaustiveness_boolean.kt") public void testExhaustiveness_boolean() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_boolean.kt"); } + @Test @TestMetadata("exhaustiveness_enum.kt") public void testExhaustiveness_enum() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_enum.kt"); } + @Test @TestMetadata("exhaustiveness_enumJava.kt") public void testExhaustiveness_enumJava() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_enumJava.kt"); } + @Test @TestMetadata("exhaustiveness_sealedClass.kt") public void testExhaustiveness_sealedClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedClass.kt"); } + @Test @TestMetadata("exhaustiveness_sealedObject.kt") public void testExhaustiveness_sealedObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedObject.kt"); } + @Test @TestMetadata("exhaustiveness_sealedSubClass.kt") public void testExhaustiveness_sealedSubClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedSubClass.kt"); } + @Test @TestMetadata("extension.kt") public void testExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/extension.kt"); } + @Test @TestMetadata("F.kt") public void testF() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/F.kt"); } + @Test @TestMetadata("fakeRecursiveSupertype.kt") public void testFakeRecursiveSupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt"); } + @Test @TestMetadata("fakeRecursiveTypealias.kt") public void testFakeRecursiveTypealias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt"); } + @Test @TestMetadata("fib.kt") public void testFib() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fib.kt"); } + @Test @TestMetadata("flexibleCapturedType.kt") public void testFlexibleCapturedType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/flexibleCapturedType.kt"); } + @Test @TestMetadata("ft.kt") public void testFt() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/ft.kt"); } + @Test @TestMetadata("functionTypeAlias.kt") public void testFunctionTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/functionTypeAlias.kt"); } + @Test @TestMetadata("functionTypes.kt") public void testFunctionTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/functionTypes.kt"); } + @Test @TestMetadata("genericConstructors.kt") public void testGenericConstructors() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/genericConstructors.kt"); } + @Test @TestMetadata("genericFunctions.kt") public void testGenericFunctions() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/genericFunctions.kt"); } + @Test @TestMetadata("genericReceiverPropertyOverride.kt") public void testGenericReceiverPropertyOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/genericReceiverPropertyOverride.kt"); } + @Test @TestMetadata("implicitTypeInFakeOverride.kt") public void testImplicitTypeInFakeOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"); } + @Test @TestMetadata("incorrectSuperCall.kt") public void testIncorrectSuperCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt"); } + @Test @TestMetadata("intersectionScope.kt") public void testIntersectionScope() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/intersectionScope.kt"); } + @Test @TestMetadata("intersectionTypes.kt") public void testIntersectionTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt"); } + @Test @TestMetadata("invokeInWhenSubjectVariableInitializer.kt") public void testInvokeInWhenSubjectVariableInitializer() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/invokeInWhenSubjectVariableInitializer.kt"); } + @Test @TestMetadata("invokeOfLambdaWithReceiver.kt") public void testInvokeOfLambdaWithReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/invokeOfLambdaWithReceiver.kt"); } + @Test @TestMetadata("javaFieldVsAccessor.kt") public void testJavaFieldVsAccessor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/javaFieldVsAccessor.kt"); } + @Test @TestMetadata("javaStaticScopeInheritance.kt") public void testJavaStaticScopeInheritance() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/javaStaticScopeInheritance.kt"); } + @Test @TestMetadata("kt41984.kt") public void testKt41984() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/kt41984.kt"); } + @Test @TestMetadata("kt41990.kt") public void testKt41990() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/kt41990.kt"); } + @Test @TestMetadata("labelAndReceiverForInfix.kt") public void testLabelAndReceiverForInfix() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/labelAndReceiverForInfix.kt"); } + @Test @TestMetadata("lambdaArgInScopeFunction.kt") public void testLambdaArgInScopeFunction() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt"); } + @Test @TestMetadata("lambdaInLhsOfTypeOperatorCall.kt") public void testLambdaInLhsOfTypeOperatorCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/lambdaInLhsOfTypeOperatorCall.kt"); } + @Test @TestMetadata("lambdaPropertyTypeInference.kt") public void testLambdaPropertyTypeInference() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt"); } + @Test @TestMetadata("localFunctionsHiding.kt") public void testLocalFunctionsHiding() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/localFunctionsHiding.kt"); } + @Test @TestMetadata("localObject.kt") public void testLocalObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/localObject.kt"); } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/nestedClass.kt"); } + @Test @TestMetadata("nestedClassContructor.kt") public void testNestedClassContructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt"); } + @Test @TestMetadata("nestedClassNameClash.kt") public void testNestedClassNameClash() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/nestedClassNameClash.kt"); } + @Test @TestMetadata("NestedOfAliasedType.kt") public void testNestedOfAliasedType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/NestedOfAliasedType.kt"); } + @Test @TestMetadata("nestedReturnType.kt") public void testNestedReturnType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/nestedReturnType.kt"); } + @Test @TestMetadata("NestedSuperType.kt") public void testNestedSuperType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/NestedSuperType.kt"); } + @Test @TestMetadata("objectInnerClass.kt") public void testObjectInnerClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt"); } + @Test @TestMetadata("offOrderMultiBoundGenericOverride.kt") public void testOffOrderMultiBoundGenericOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/offOrderMultiBoundGenericOverride.kt"); } + @Test @TestMetadata("openInInterface.kt") public void testOpenInInterface() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/openInInterface.kt"); } + @Test @TestMetadata("problems2.kt") public void testProblems2() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems2.kt"); } + @Test @TestMetadata("propertyFromJavaPlusAssign.kt") public void testPropertyFromJavaPlusAssign() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/propertyFromJavaPlusAssign.kt"); } + @Test @TestMetadata("qualifierWithCompanion.kt") public void testQualifierWithCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/qualifierWithCompanion.kt"); } + @Test @TestMetadata("rawTypeSam.kt") public void testRawTypeSam() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/rawTypeSam.kt"); } + @Test @TestMetadata("recursiveCallOnWhenWithSealedClass.kt") public void testRecursiveCallOnWhenWithSealedClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/recursiveCallOnWhenWithSealedClass.kt"); } + @Test @TestMetadata("sealedClass.kt") public void testSealedClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt"); } + @Test @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/simpleClass.kt"); } + @Test @TestMetadata("simpleTypeAlias.kt") public void testSimpleTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/simpleTypeAlias.kt"); } + @Test @TestMetadata("spreadOperator.kt") public void testSpreadOperator() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/spreadOperator.kt"); } + @Test @TestMetadata("statusResolveForTypealiasAsSuperClass.kt") public void testStatusResolveForTypealiasAsSuperClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/statusResolveForTypealiasAsSuperClass.kt"); } + @Test @TestMetadata("syntheticsVsNormalProperties.kt") public void testSyntheticsVsNormalProperties() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt"); } + @Test @TestMetadata("treeSet.kt") public void testTreeSet() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/treeSet.kt"); } + @Test @TestMetadata("tryInference.kt") public void testTryInference() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/tryInference.kt"); } + @Test @TestMetadata("TwoDeclarationsInSameFile.kt") public void testTwoDeclarationsInSameFile() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/TwoDeclarationsInSameFile.kt"); } + @Test @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/typeAliasWithGeneric.kt"); } + @Test @TestMetadata("typeAliasWithTypeArguments.kt") public void testTypeAliasWithTypeArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt"); } + @Test @TestMetadata("typeFromGetter.kt") public void testTypeFromGetter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/typeFromGetter.kt"); } + @Test @TestMetadata("typeParameterInPropertyReceiver.kt") public void testTypeParameterInPropertyReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/typeParameterInPropertyReceiver.kt"); } + @Test @TestMetadata("typeParameterVsNested.kt") public void testTypeParameterVsNested() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt"); } + @Test @TestMetadata("typesInLocalFunctions.kt") public void testTypesInLocalFunctions() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/typesInLocalFunctions.kt"); } + @Test @TestMetadata("varargInPrimaryConstructor.kt") public void testVarargInPrimaryConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.kt"); } + @Test @TestMetadata("whenAsReceiver.kt") public void testWhenAsReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.kt"); } + @Test @TestMetadata("whenElse.kt") public void testWhenElse() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/whenElse.kt"); } + @Test @TestMetadata("whenExpressionType.kt") public void testWhenExpressionType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/whenExpressionType.kt"); } + @Test @TestMetadata("whenInference.kt") public void testWhenInference() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/whenInference.kt"); } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Arguments extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Arguments extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInArguments() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/arguments"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("ambiguityOnJavaOverride.kt") public void testAmbiguityOnJavaOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt"); } + @Test @TestMetadata("argumentsOfAnnotations.kt") public void testArgumentsOfAnnotations() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.kt"); } + @Test @TestMetadata("argumentsOfJavaAnnotation.kt") public void testArgumentsOfJavaAnnotation() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfJavaAnnotation.kt"); } + @Test @TestMetadata("default.kt") public void testDefault() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/default.kt"); } + @Test @TestMetadata("defaultFromOverrides.kt") public void testDefaultFromOverrides() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt"); } + @Test @TestMetadata("definetelyNotNullForTypeParameter.kt") public void testDefinetelyNotNullForTypeParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.kt"); } + @Test @TestMetadata("extensionLambdaInDefaultArgument.kt") public void testExtensionLambdaInDefaultArgument() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/extensionLambdaInDefaultArgument.kt"); } + @Test @TestMetadata("fieldPlusAssign.kt") public void testFieldPlusAssign() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/fieldPlusAssign.kt"); } + @Test @TestMetadata("incorrectFunctionalType.kt") public void testIncorrectFunctionalType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/incorrectFunctionalType.kt"); } + @Test @TestMetadata("integerLiteralTypes.kt") public void testIntegerLiteralTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt"); } + @Test @TestMetadata("invoke.kt") public void testInvoke() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/invoke.kt"); } + @Test @TestMetadata("javaAnnotationsWithArrayValue.kt") public void testJavaAnnotationsWithArrayValue() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.kt"); } + @Test @TestMetadata("javaArrayVariance.kt") public void testJavaArrayVariance() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt"); } + @Test @TestMetadata("kt41940.kt") public void testKt41940() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/kt41940.kt"); } + @Test @TestMetadata("lambda.kt") public void testLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt"); } + @Test @TestMetadata("lambdaInLambda.kt") public void testLambdaInLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.kt"); } + @Test @TestMetadata("lambdaInLambda2.kt") public void testLambdaInLambda2() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.kt"); } + @Test @TestMetadata("lambdaInUnresolvedCall.kt") public void testLambdaInUnresolvedCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt"); } + @Test @TestMetadata("namedArrayInAnnotation.kt") public void testNamedArrayInAnnotation() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/namedArrayInAnnotation.kt"); } + @Test @TestMetadata("operatorsOverLiterals.kt") public void testOperatorsOverLiterals() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt"); } + @Test @TestMetadata("overloadByReceiver.kt") public void testOverloadByReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/overloadByReceiver.kt"); } + @Test @TestMetadata("overloadWithDefault.kt") public void testOverloadWithDefault() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/overloadWithDefault.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt"); } + @Test @TestMetadata("stringTemplates.kt") public void testStringTemplates() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/stringTemplates.kt"); } + @Test @TestMetadata("tryInLambda.kt") public void testTryInLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/tryInLambda.kt"); } + @Test @TestMetadata("untouchedReturnInIf.kt") public void testUntouchedReturnInIf() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/untouchedReturnInIf.kt"); } + @Test @TestMetadata("vararg.kt") public void testVararg() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt"); } + @Test @TestMetadata("varargOfLambdasWithReceiver.kt") public void testVarargOfLambdasWithReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.kt"); } + @Test @TestMetadata("varargProjection.kt") public void testVarargProjection() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arguments/varargProjection.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arrays") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Arrays extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Arrays extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInArrays() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/arrays"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("arraySet.kt") public void testArraySet() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arrays/arraySet.kt"); } + @Test @TestMetadata("arraySetWithOperation.kt") public void testArraySetWithOperation() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/builtins") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Builtins extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Builtins extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInBuiltins() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/builtins"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("lists.kt") public void testLists() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/builtins/lists.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/callResolution") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CallResolution extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class CallResolution extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInCallResolution() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/callResolution"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("companionInvoke.kt") public void testCompanionInvoke() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/companionInvoke.kt"); } + @Test @TestMetadata("companionVsSuperStatic.kt") public void testCompanionVsSuperStatic() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/companionVsSuperStatic.kt"); } + @Test @TestMetadata("debugExpressionType.kt") public void testDebugExpressionType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/debugExpressionType.kt"); } + @Test @TestMetadata("debugInfoCall.kt") public void testDebugInfoCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/debugInfoCall.kt"); } + @Test @TestMetadata("errorCandidates.kt") public void testErrorCandidates() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt"); } + @Test @TestMetadata("extensionInvokeAfterSafeCall.kt") public void testExtensionInvokeAfterSafeCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/extensionInvokeAfterSafeCall.kt"); } + @Test @TestMetadata("invokeAmbiguity.kt") public void testInvokeAmbiguity() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.kt"); } + @Test @TestMetadata("invokeWithReceiverAndArgument.kt") public void testInvokeWithReceiverAndArgument() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt"); } + @Test @TestMetadata("lambdaAsReceiver.kt") public void testLambdaAsReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt"); } + @Test @TestMetadata("objectInvoke.kt") public void testObjectInvoke() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/objectInvoke.kt"); } + @Test @TestMetadata("safeCallOnTypeAlias.kt") public void testSafeCallOnTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/safeCallOnTypeAlias.kt"); } + @Test @TestMetadata("superAny.kt") public void testSuperAny() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/superAny.kt"); } + @Test @TestMetadata("syntheticPropertiesWrongImplicitReceiver.kt") public void testSyntheticPropertiesWrongImplicitReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/syntheticPropertiesWrongImplicitReceiver.kt"); } + @Test @TestMetadata("typeAliasWithNotNullBound.kt") public void testTypeAliasWithNotNullBound() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/typeAliasWithNotNullBound.kt"); } + @Test @TestMetadata("uselessMultipleBounds.kt") public void testUselessMultipleBounds() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/uselessMultipleBounds.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/cfg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Cfg extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Cfg extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInCfg() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/cfg"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("annotatedLocalClass.kt") public void testAnnotatedLocalClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.kt"); } + @Test @TestMetadata("binaryOperations.kt") public void testBinaryOperations() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/binaryOperations.kt"); } + @Test @TestMetadata("booleanOperatorsWithConsts.kt") public void testBooleanOperatorsWithConsts() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/booleanOperatorsWithConsts.kt"); } + @Test @TestMetadata("complex.kt") public void testComplex() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/complex.kt"); } + @Test @TestMetadata("defaultArguments.kt") public void testDefaultArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.kt"); } + @Test @TestMetadata("emptyWhen.kt") public void testEmptyWhen() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/emptyWhen.kt"); } + @Test @TestMetadata("flowFromInplaceLambda.kt") public void testFlowFromInplaceLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt"); } + @Test @TestMetadata("initBlock.kt") public void testInitBlock() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.kt"); } + @Test @TestMetadata("initBlockAndInPlaceLambda.kt") public void testInitBlockAndInPlaceLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.kt"); } + @Test @TestMetadata("innerClassInAnonymousObject.kt") public void testInnerClassInAnonymousObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.kt"); } + @Test @TestMetadata("inplaceLambdaInControlFlowExpressions.kt") public void testInplaceLambdaInControlFlowExpressions() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.kt"); } + @Test @TestMetadata("jumps.kt") public void testJumps() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt"); } + @Test @TestMetadata("lambdaAsReturnOfLambda.kt") public void testLambdaAsReturnOfLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.kt"); } + @Test @TestMetadata("lambdaReturningObject.kt") public void testLambdaReturningObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.kt"); } + @Test @TestMetadata("lambdas.kt") public void testLambdas() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.kt"); } + @Test @TestMetadata("localClassesWithImplicit.kt") public void testLocalClassesWithImplicit() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.kt"); } + @Test @TestMetadata("loops.kt") public void testLoops() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/loops.kt"); } + @Test @TestMetadata("postponedLambdaInConstructor.kt") public void testPostponedLambdaInConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.kt"); } + @Test @TestMetadata("postponedLambdas.kt") public void testPostponedLambdas() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.kt"); } + @Test @TestMetadata("propertiesAndInitBlocks.kt") public void testPropertiesAndInitBlocks() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.kt"); } + @Test @TestMetadata("returnValuesFromLambda.kt") public void testReturnValuesFromLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.kt"); } + @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/simple.kt"); } + @Test @TestMetadata("tryCatch.kt") public void testTryCatch() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/cfg/when.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/constructors") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constructors extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Constructors extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInConstructors() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/constructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("noSuperCallInSupertypes.kt") public void testNoSuperCallInSupertypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/constructors/noSuperCallInSupertypes.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/delegates") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Delegates extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Delegates extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInDelegates() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/delegates"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("delegateInference.kt") public void testDelegateInference() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.kt"); } + @Test @TestMetadata("delegateWithLambda.kt") public void testDelegateWithLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt"); } + @Test @TestMetadata("extensionGenericGetValue.kt") public void testExtensionGenericGetValue() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegates/extensionGenericGetValue.kt"); } + @Test @TestMetadata("extensionGetValueWithTypeVariableAsReceiver.kt") public void testExtensionGetValueWithTypeVariableAsReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegates/extensionGetValueWithTypeVariableAsReceiver.kt"); } + @Test @TestMetadata("kt41982.kt") public void testKt41982() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.kt"); } + @Test @TestMetadata("provideDelegate.kt") public void testProvideDelegate() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Diagnostics extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Diagnostics extends AbstractFirDiagnosticsWithLightTreeTest { + @Test @TestMetadata("abstractSuperCall.kt") public void testAbstractSuperCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt"); } + @Test @TestMetadata("abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt") public void testAbstractSuperCallInPresenseOfNonAbstractMethodInParent() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt"); } + @Test public void testAllFilesPresentInDiagnostics() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("annotationArgumentKClassLiteralTypeError.kt") public void testAnnotationArgumentKClassLiteralTypeError() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.kt"); } + @Test @TestMetadata("annotationArgumentMustBeConst.kt") public void testAnnotationArgumentMustBeConst() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeConst.kt"); } + @Test @TestMetadata("annotationArgumentMustBeEnumConst.kt") public void testAnnotationArgumentMustBeEnumConst() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeEnumConst.kt"); } + @Test @TestMetadata("annotationArgumentMustBeKClassLiteral.kt") public void testAnnotationArgumentMustBeKClassLiteral() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeKClassLiteral.kt"); } + @Test @TestMetadata("annotationClassMember.kt") public void testAnnotationClassMember() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationClassMember.kt"); } + @Test @TestMetadata("anonymousObjectByDelegate.kt") public void testAnonymousObjectByDelegate() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.kt"); } + @Test @TestMetadata("classInSupertypeForEnum.kt") public void testClassInSupertypeForEnum() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt"); } + @Test @TestMetadata("conflictingOverloads.kt") public void testConflictingOverloads() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt"); } + @Test @TestMetadata("conflictingProjection.kt") public void testConflictingProjection() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingProjection.kt"); } + @Test @TestMetadata("constructorInInterface.kt") public void testConstructorInInterface() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/constructorInInterface.kt"); } + @Test @TestMetadata("cyclicConstructorDelegationCall.kt") public void testCyclicConstructorDelegationCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt"); } + @Test @TestMetadata("delegationInInterface.kt") public void testDelegationInInterface() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt"); } + @Test @TestMetadata("delegationSuperCallInEnumConstructor.kt") public void testDelegationSuperCallInEnumConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt"); } + @Test @TestMetadata("explicitDelegationCallRequired.kt") public void testExplicitDelegationCallRequired() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt"); } + @Test @TestMetadata("inapplicableLateinitModifier.kt") public void testInapplicableLateinitModifier() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.kt"); } + @Test @TestMetadata("incompatibleModifiers.kt") public void testIncompatibleModifiers() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/incompatibleModifiers.kt"); } + @Test @TestMetadata("infixFunctions.kt") public void testInfixFunctions() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/infixFunctions.kt"); } + @Test @TestMetadata("instanceAccessBeforeSuperCall.kt") public void testInstanceAccessBeforeSuperCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt"); } + @Test @TestMetadata("interfaceWithSuperclass.kt") public void testInterfaceWithSuperclass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt"); } + @Test @TestMetadata("localAnnotationClass.kt") public void testLocalAnnotationClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/localAnnotationClass.kt"); } + @Test @TestMetadata("localEntitytNotAllowed.kt") public void testLocalEntitytNotAllowed() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/localEntitytNotAllowed.kt"); } + @Test @TestMetadata("manyCompanionObjects.kt") public void testManyCompanionObjects() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/manyCompanionObjects.kt"); } + @Test @TestMetadata("methodOfAnyImplementedInInterface.kt") public void testMethodOfAnyImplementedInInterface() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/methodOfAnyImplementedInInterface.kt"); } + @Test @TestMetadata("nonConstValInAnnotationArgument.kt") public void testNonConstValInAnnotationArgument() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/nonConstValInAnnotationArgument.kt"); } + @Test @TestMetadata("notASupertype.kt") public void testNotASupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt"); } + @Test @TestMetadata("primaryConstructorRequiredForDataClass.kt") public void testPrimaryConstructorRequiredForDataClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt"); } + @Test @TestMetadata("projectionsOnNonClassTypeArguments.kt") public void testProjectionsOnNonClassTypeArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/projectionsOnNonClassTypeArguments.kt"); } + @Test @TestMetadata("propertyTypeMismatchOnOverride.kt") public void testPropertyTypeMismatchOnOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt"); } + @Test @TestMetadata("qualifiedSupertypeExtendedByOtherSupertype.kt") public void testQualifiedSupertypeExtendedByOtherSupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.kt"); } + @Test @TestMetadata("redundantModifier.kt") public void testRedundantModifier() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/redundantModifier.kt"); } + @Test @TestMetadata("repeatedModifier.kt") public void testRepeatedModifier() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.kt"); } + @Test @TestMetadata("returnTypeMismatchOnOverride.kt") public void testReturnTypeMismatchOnOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt"); } + @Test @TestMetadata("sealedClassConstructorCall.kt") public void testSealedClassConstructorCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt"); } + @Test @TestMetadata("sealedSupertype.kt") public void testSealedSupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt"); } + @Test @TestMetadata("someOverridesTest.kt") public void testSomeOverridesTest() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/someOverridesTest.kt"); } + @Test @TestMetadata("superCallWithDelegation.kt") public void testSuperCallWithDelegation() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.kt"); } + @Test @TestMetadata("superIsNotAnExpression.kt") public void testSuperIsNotAnExpression() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt"); } + @Test @TestMetadata("superNotAvailable.kt") public void testSuperNotAvailable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt"); } + @Test @TestMetadata("superclassNotAccessibleFromInterface.kt") public void testSuperclassNotAccessibleFromInterface() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superclassNotAccessibleFromInterface.kt"); } + @Test @TestMetadata("supertypeInitializedInInterface.kt") public void testSupertypeInitializedInInterface() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt"); } + @Test @TestMetadata("supertypeInitializedWithoutPrimaryConstructor.kt") public void testSupertypeInitializedWithoutPrimaryConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt"); } + @Test @TestMetadata("testIllegalAnnotationClass.kt") public void testTestIllegalAnnotationClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/testIllegalAnnotationClass.kt"); } + @Test @TestMetadata("typeArgumentsNotAllowed.kt") public void testTypeArgumentsNotAllowed() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt"); } + @Test @TestMetadata("typeOfAnnotationMember.kt") public void testTypeOfAnnotationMember() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeOfAnnotationMember.kt"); } + @Test @TestMetadata("typeParametersInEnum.kt") public void testTypeParametersInEnum() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeParametersInEnum.kt"); } + @Test @TestMetadata("typeParametersInObject.kt") public void testTypeParametersInObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeParametersInObject.kt"); } + @Test @TestMetadata("upperBoundViolated.kt") public void testUpperBoundViolated() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt"); } + @Test @TestMetadata("valOnAnnotationParameter.kt") public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Expresssions extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Expresssions extends AbstractFirDiagnosticsWithLightTreeTest { + @Test @TestMetadata("access.kt") public void testAccess() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt"); } + @Test public void testAllFilesPresentInExpresssions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("annotationWithReturn.kt") public void testAnnotationWithReturn() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/annotationWithReturn.kt"); } + @Test @TestMetadata("annotations.kt") public void testAnnotations() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/annotations.kt"); } + @Test @TestMetadata("baseQualifier.kt") public void testBaseQualifier() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt"); } + @Test @TestMetadata("blockLocalScopes.kt") public void testBlockLocalScopes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/blockLocalScopes.kt"); } + @Test @TestMetadata("CallBasedInExpressionGenerator.kt") public void testCallBasedInExpressionGenerator() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt"); } + @Test @TestMetadata("checkArguments.kt") public void testCheckArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/checkArguments.kt"); } + @Test @TestMetadata("classifierAccessFromCompanion.kt") public void testClassifierAccessFromCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/classifierAccessFromCompanion.kt"); } + @Test @TestMetadata("companion.kt") public void testCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/companion.kt"); } + @Test @TestMetadata("companionExtension.kt") public void testCompanionExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/companionExtension.kt"); } + @Test @TestMetadata("constructor.kt") public void testConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/constructor.kt"); } + @Test @TestMetadata("dispatchReceiver.kt") public void testDispatchReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/dispatchReceiver.kt"); } + @Test @TestMetadata("enumEntryUse.kt") public void testEnumEntryUse() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt"); } + @Test @TestMetadata("enumValues.kt") public void testEnumValues() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.kt"); } + @Test @TestMetadata("errCallable.kt") public void testErrCallable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt"); } + @Test @TestMetadata("extensionPropertyInLambda.kt") public void testExtensionPropertyInLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/extensionPropertyInLambda.kt"); } + @Test @TestMetadata("genericDecorator.kt") public void testGenericDecorator() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.kt"); } + @Test @TestMetadata("genericDescriptor.kt") public void testGenericDescriptor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.kt"); } + @Test @TestMetadata("genericDiagnostic.kt") public void testGenericDiagnostic() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDiagnostic.kt"); } + @Test @TestMetadata("genericPropertyAccess.kt") public void testGenericPropertyAccess() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericPropertyAccess.kt"); } + @Test @TestMetadata("genericUsedInFunction.kt") public void testGenericUsedInFunction() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericUsedInFunction.kt"); } + @Test @TestMetadata("importedReceiver.kt") public void testImportedReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.kt"); } + @Test @TestMetadata("innerQualifier.kt") public void testInnerQualifier() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/innerQualifier.kt"); } + @Test @TestMetadata("innerWithSuperCompanion.kt") public void testInnerWithSuperCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/innerWithSuperCompanion.kt"); } + @Test @TestMetadata("javaFieldCallable.kt") public void testJavaFieldCallable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/javaFieldCallable.kt"); } + @Test @TestMetadata("lambda.kt") public void testLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt"); } + @Test @TestMetadata("lambdaWithReceiver.kt") public void testLambdaWithReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/lambdaWithReceiver.kt"); } + @Test @TestMetadata("localClassAccessesContainingClass.kt") public void testLocalClassAccessesContainingClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localClassAccessesContainingClass.kt"); } + @Test @TestMetadata("localConstructor.kt") public void testLocalConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localConstructor.kt"); } + @Test @TestMetadata("localExtension.kt") public void testLocalExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localExtension.kt"); } + @Test @TestMetadata("localImplicitBodies.kt") public void testLocalImplicitBodies() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.kt"); } + @Test @TestMetadata("localInnerClass.kt") public void testLocalInnerClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.kt"); } + @Test @TestMetadata("localObjects.kt") public void testLocalObjects() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt"); } + @Test @TestMetadata("localScopes.kt") public void testLocalScopes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.kt"); } + @Test @TestMetadata("localTypes.kt") public void testLocalTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localTypes.kt"); } + @Test @TestMetadata("localWithBooleanNot.kt") public void testLocalWithBooleanNot() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.kt"); } + @Test @TestMetadata("memberExtension.kt") public void testMemberExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/memberExtension.kt"); } + @Test @TestMetadata("nestedConstructorCallable.kt") public void testNestedConstructorCallable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedConstructorCallable.kt"); } + @Test @TestMetadata("nestedObjects.kt") public void testNestedObjects() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt"); } + @Test @TestMetadata("nestedVisibility.kt") public void testNestedVisibility() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt"); } + @Test @TestMetadata("objectOverrideCallViaImport.kt") public void testObjectOverrideCallViaImport() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objectOverrideCallViaImport.kt"); } + @Test @TestMetadata("objectVsProperty.kt") public void testObjectVsProperty() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objectVsProperty.kt"); } + @Test @TestMetadata("objects.kt") public void testObjects() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objects.kt"); } + @Test @TestMetadata("outerMemberAccesses.kt") public void testOuterMemberAccesses() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.kt"); } + @Test @TestMetadata("outerObject.kt") public void testOuterObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/outerObject.kt"); } + @Test @TestMetadata("overriddenJavaGetter.kt") public void testOverriddenJavaGetter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/overriddenJavaGetter.kt"); } + @Test @TestMetadata("privateObjectLiteral.kt") public void testPrivateObjectLiteral() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.kt"); } + @Test @TestMetadata("privateVisibility.kt") public void testPrivateVisibility() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt"); } + @Test @TestMetadata("protectedVisibility.kt") public void testProtectedVisibility() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt"); } + @Test @TestMetadata("qualifiedExpressions.kt") public void testQualifiedExpressions() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/qualifiedExpressions.kt"); } + @Test @TestMetadata("qualifierPriority.kt") public void testQualifierPriority() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/qualifierPriority.kt"); } + @Test @TestMetadata("receiverConsistency.kt") public void testReceiverConsistency() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt"); } + @Test @TestMetadata("sameReceiver.kt") public void testSameReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/sameReceiver.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/simple.kt"); } + @Test @TestMetadata("syntheticInImplicitBody.kt") public void testSyntheticInImplicitBody() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticInImplicitBody.kt"); } + @Test @TestMetadata("syntheticSmartCast.kt") public void testSyntheticSmartCast() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt"); } + @Test @TestMetadata("this.kt") public void testThis() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/this.kt"); } + @Test @TestMetadata("topExtensionVsOuterMember.kt") public void testTopExtensionVsOuterMember() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/topExtensionVsOuterMember.kt"); } + @Test @TestMetadata("typeAliasConstructor.kt") public void testTypeAliasConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/typeAliasConstructor.kt"); } + @Test @TestMetadata("vararg.kt") public void testVararg() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/vararg.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/when.kt"); } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/inference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inference extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInInference() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("id.kt") public void testId() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/id.kt"); } + @Test @TestMetadata("typeParameters.kt") public void testTypeParameters() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt"); } + @Test @TestMetadata("typeParameters2.kt") public void testTypeParameters2() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Invoke extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Invoke extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInInvoke() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("doubleBrackets.kt") public void testDoubleBrackets() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/doubleBrackets.kt"); } + @Test @TestMetadata("explicitReceiver.kt") public void testExplicitReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/explicitReceiver.kt"); } + @Test @TestMetadata("explicitReceiver2.kt") public void testExplicitReceiver2() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/explicitReceiver2.kt"); } + @Test @TestMetadata("extension.kt") public void testExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extension.kt"); } + @Test @TestMetadata("extensionOnObject.kt") public void testExtensionOnObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionOnObject.kt"); } + @Test @TestMetadata("extensionSafeCall.kt") public void testExtensionSafeCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.kt"); } + @Test @TestMetadata("farInvokeExtension.kt") public void testFarInvokeExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/farInvokeExtension.kt"); } + @Test @TestMetadata("implicitTypeOrder.kt") public void testImplicitTypeOrder() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/implicitTypeOrder.kt"); } + @Test @TestMetadata("inBrackets.kt") public void testInBrackets() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/inBrackets.kt"); } + @Test @TestMetadata("incorrectInvokeReceiver.kt") public void testIncorrectInvokeReceiver() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/incorrectInvokeReceiver.kt"); } + @Test @TestMetadata("propertyFromParameter.kt") public void testPropertyFromParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/propertyFromParameter.kt"); } + @Test @TestMetadata("propertyWithExtensionType.kt") public void testPropertyWithExtensionType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/propertyWithExtensionType.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/simple.kt"); } + @Test @TestMetadata("threeReceivers.kt") public void testThreeReceivers() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt"); } + @Test @TestMetadata("threeReceiversCorrect.kt") public void testThreeReceiversCorrect() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/operators") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Operators extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Operators extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInOperators() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/operators"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("plus.kt") public void testPlus() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plus.kt"); } + @Test @TestMetadata("plusAndPlusAssign.kt") public void testPlusAndPlusAssign() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plusAndPlusAssign.kt"); } + @Test @TestMetadata("plusAssign.kt") public void testPlusAssign() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plusAssign.kt"); @@ -1685,930 +1944,993 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/fromBuilder") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FromBuilder extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class FromBuilder extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInFromBuilder() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/fromBuilder"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/complexTypes.kt"); } + @Test @TestMetadata("enums.kt") public void testEnums() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt"); } + @Test @TestMetadata("noPrimaryConstructor.kt") public void testNoPrimaryConstructor() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/noPrimaryConstructor.kt"); } + @Test @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/simpleClass.kt"); } + @Test @TestMetadata("typeParameters.kt") public void testTypeParameters() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/typeParameters.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/inference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inference extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInInference() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("callableReferenceOnInstance.kt") public void testCallableReferenceOnInstance() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferenceOnInstance.kt"); } + @Test @TestMetadata("callableReferenceToLocalClass.kt") public void testCallableReferenceToLocalClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferenceToLocalClass.kt"); } + @Test @TestMetadata("callableReferencesAndDefaultParameters.kt") public void testCallableReferencesAndDefaultParameters() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferencesAndDefaultParameters.kt"); } + @Test @TestMetadata("capturedTypeForJavaTypeParameter.kt") public void testCapturedTypeForJavaTypeParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/capturedTypeForJavaTypeParameter.kt"); } + @Test @TestMetadata("coercionToUnitWithEarlyReturn.kt") public void testCoercionToUnitWithEarlyReturn() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/coercionToUnitWithEarlyReturn.kt"); } + @Test @TestMetadata("definitelyNotNullIntersectionType.kt") public void testDefinitelyNotNullIntersectionType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/definitelyNotNullIntersectionType.kt"); } + @Test @TestMetadata("extensionCallableReferences.kt") public void testExtensionCallableReferences() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/extensionCallableReferences.kt"); } + @Test @TestMetadata("integerLiteralAsComparable.kt") public void testIntegerLiteralAsComparable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/integerLiteralAsComparable.kt"); } + @Test @TestMetadata("intersectionTypesInConstraints.kt") public void testIntersectionTypesInConstraints() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/intersectionTypesInConstraints.kt"); } + @Test @TestMetadata("kt40131.kt") public void testKt40131() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/kt40131.kt"); } + @Test @TestMetadata("kt41989.kt") public void testKt41989() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/kt41989.kt"); } + @Test @TestMetadata("lambdaAsReturnStatementOfLambda.kt") public void testLambdaAsReturnStatementOfLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdaAsReturnStatementOfLambda.kt"); } + @Test @TestMetadata("lambdaInElvis.kt") public void testLambdaInElvis() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdaInElvis.kt"); } + @Test @TestMetadata("nestedExtensionFunctionType.kt") public void testNestedExtensionFunctionType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.kt"); } + @Test @TestMetadata("nestedLambdas.kt") public void testNestedLambdas() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/nestedLambdas.kt"); } + @Test @TestMetadata("nullableIntegerLiteralType.kt") public void testNullableIntegerLiteralType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt"); } + @Test @TestMetadata("receiverWithCapturedType.kt") public void testReceiverWithCapturedType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt"); } + @Test @TestMetadata("simpleCapturedTypes.kt") public void testSimpleCapturedTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/simpleCapturedTypes.kt"); } + @Test @TestMetadata("typeDepthForTypeAlias.kt") public void testTypeDepthForTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/inference/typeDepthForTypeAlias.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/innerClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InnerClasses extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class InnerClasses extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInInnerClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/innerClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("inner.kt") public void testInner() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt"); } + @Test @TestMetadata("innerTypeFromSuperClassInBody.kt") public void testInnerTypeFromSuperClassInBody() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypeFromSuperClassInBody.kt"); } + @Test @TestMetadata("innerTypes.kt") public void testInnerTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/localClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalClasses extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class LocalClasses extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInLocalClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/localClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("implicitInAnonymous.kt") public void testImplicitInAnonymous() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.kt"); } + @Test @TestMetadata("implicitInLocalClasses.kt") public void testImplicitInLocalClasses() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInLocalClasses.kt"); } + @Test @TestMetadata("typesFromSuperClasses.kt") public void testTypesFromSuperClasses() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/typesFromSuperClasses.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/multifile") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Multifile extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Multifile extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInMultifile() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/multifile"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("Annotations.kt") public void testAnnotations() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.kt"); } + @Test @TestMetadata("ByteArray.kt") public void testByteArray() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/ByteArray.kt"); } + @Test @TestMetadata("importFromObject.kt") public void testImportFromObject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/importFromObject.kt"); } + @Test @TestMetadata("NestedSuperType.kt") public void testNestedSuperType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/NestedSuperType.kt"); } + @Test @TestMetadata("sealedStarImport.kt") public void testSealedStarImport() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt"); } + @Test @TestMetadata("simpleAliasedImport.kt") public void testSimpleAliasedImport() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleAliasedImport.kt"); } + @Test @TestMetadata("simpleImport.kt") public void testSimpleImport() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImport.kt"); } + @Test @TestMetadata("simpleImportNested.kt") public void testSimpleImportNested() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImportNested.kt"); } + @Test @TestMetadata("simpleImportOuter.kt") public void testSimpleImportOuter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImportOuter.kt"); } + @Test @TestMetadata("simpleStarImport.kt") public void testSimpleStarImport() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt"); } + @Test @TestMetadata("TypeAliasExpansion.kt") public void testTypeAliasExpansion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/multifile/TypeAliasExpansion.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/overrides") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Overrides extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Overrides extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInOverrides() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/overrides"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("generics.kt") public void testGenerics() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/generics.kt"); } + @Test @TestMetadata("protobufExt.kt") public void testProtobufExt() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/protobufExt.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt"); } + @Test @TestMetadata("simpleFakeOverride.kt") public void testSimpleFakeOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simpleFakeOverride.kt"); } + @Test @TestMetadata("simpleMostSpecific.kt") public void testSimpleMostSpecific() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simpleMostSpecific.kt"); } + @Test @TestMetadata("supertypeGenerics.kt") public void testSupertypeGenerics() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenerics.kt"); } + @Test @TestMetadata("supertypeGenericsComplex.kt") public void testSupertypeGenericsComplex() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt"); } + @Test @TestMetadata("three.kt") public void testThree() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/overrides/three.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/problems") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Problems extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInProblems() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("compilerPhase.kt") public void testCompilerPhase() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.kt"); } + @Test @TestMetadata("complexLambdaWithTypeVariableAsExpectedType.kt") public void testComplexLambdaWithTypeVariableAsExpectedType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.kt"); } + @Test @TestMetadata("defaultParametersFromDifferentScopes.kt") public void testDefaultParametersFromDifferentScopes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/defaultParametersFromDifferentScopes.kt"); } + @Test @TestMetadata("definitelyNotNullAndOriginalType.kt") public void testDefinitelyNotNullAndOriginalType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt"); } + @Test @TestMetadata("flexibleTypeVarAgainstNull.kt") public void testFlexibleTypeVarAgainstNull() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/flexibleTypeVarAgainstNull.kt"); } + @Test @TestMetadata("inaccessibleJavaGetter.kt") public void testInaccessibleJavaGetter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt"); } + @Test @TestMetadata("innerClassHierarchy.kt") public void testInnerClassHierarchy() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/innerClassHierarchy.kt"); } + @Test @TestMetadata("javaQualifier.kt") public void testJavaQualifier() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaQualifier.kt"); } + @Test @TestMetadata("kt42346.kt") public void testKt42346() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt"); } + @Test @TestMetadata("multipleJavaClassesInOneFile.kt") public void testMultipleJavaClassesInOneFile() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt"); } + @Test @TestMetadata("objectDerivedFromInnerClass.kt") public void testObjectDerivedFromInnerClass() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/objectDerivedFromInnerClass.kt"); } + @Test @TestMetadata("questionableSmartCast.kt") public void testQuestionableSmartCast() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/questionableSmartCast.kt"); } + @Test @TestMetadata("recursiveNamedAnnotation.kt") public void testRecursiveNamedAnnotation() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.kt"); } + @Test @TestMetadata("safeCallInvoke.kt") public void testSafeCallInvoke() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.kt"); } + @Test @TestMetadata("secondaryConstructorCfg.kt") public void testSecondaryConstructorCfg() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/properties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Properties extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Properties extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/properties"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("javaAccessorConversion.kt") public void testJavaAccessorConversion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt"); } + @Test @TestMetadata("javaAccessorsComplex.kt") public void testJavaAccessorsComplex() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.kt"); } + @Test @TestMetadata("kotlinOverridesJavaComplex.kt") public void testKotlinOverridesJavaComplex() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt"); } + @Test @TestMetadata("noBackingFieldForExtension.kt") public void testNoBackingFieldForExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldForExtension.kt"); } + @Test @TestMetadata("noBackingFieldInProperty.kt") public void testNoBackingFieldInProperty() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldInProperty.kt"); } + @Test @TestMetadata("syntheticPropertiesForJavaAnnotations.kt") public void testSyntheticPropertiesForJavaAnnotations() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/references") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class References extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class References extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInReferences() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/references"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("integerLiteralInLhs.kt") public void testIntegerLiteralInLhs() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/references/integerLiteralInLhs.kt"); } + @Test @TestMetadata("referenceToExtension.kt") public void testReferenceToExtension() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/references/simple.kt"); } + @Test @TestMetadata("superMember.kt") public void testSuperMember() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/references/superMember.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/samConstructors") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SamConstructors extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class SamConstructors extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInSamConstructors() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConstructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("genericSam.kt") public void testGenericSam() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSam.kt"); } + @Test @TestMetadata("genericSamInferenceFromExpectType.kt") public void testGenericSamInferenceFromExpectType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt"); } + @Test @TestMetadata("kotlinSam.kt") public void testKotlinSam() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/kotlinSam.kt"); } + @Test @TestMetadata("realConstructorFunction.kt") public void testRealConstructorFunction() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt"); } + @Test @TestMetadata("runnable.kt") public void testRunnable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/simple.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/samConversions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SamConversions extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class SamConversions extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInSamConversions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConversions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("genericSam.kt") public void testGenericSam() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt"); } + @Test @TestMetadata("kotlinSam.kt") public void testKotlinSam() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt"); } + @Test @TestMetadata("notSamBecauseOfSupertype.kt") public void testNotSamBecauseOfSupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt"); } + @Test @TestMetadata("runnable.kt") public void testRunnable() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/runnable.kt"); } + @Test @TestMetadata("samConversionInConstructorCall.kt") public void testSamConversionInConstructorCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samConversionInConstructorCall.kt"); } + @Test @TestMetadata("samSupertype.kt") public void testSamSupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samSupertype.kt"); } + @Test @TestMetadata("samSupertypeWithOverride.kt") public void testSamSupertypeWithOverride() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samSupertypeWithOverride.kt"); } + @Test @TestMetadata("samWithEquals.kt") public void testSamWithEquals() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samWithEquals.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/simple.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Smartcasts extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Smartcasts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInSmartcasts() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("bangbang.kt") public void testBangbang() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt"); } + @Test @TestMetadata("casts.kt") public void testCasts() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt"); } + @Test @TestMetadata("equalsAndIdentity.kt") public void testEqualsAndIdentity() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt"); } + @Test @TestMetadata("kt10240.kt") public void testKt10240() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt10240.kt"); } + @Test @TestMetadata("kt37327.kt") public void testKt37327() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt37327.kt"); } + @Test @TestMetadata("kt39000.kt") public void testKt39000() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt39000.kt"); } + @Test @TestMetadata("multipleCasts.kt") public void testMultipleCasts() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt"); } + @Test @TestMetadata("orInWhenBranch.kt") public void testOrInWhenBranch() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt"); } + @Test @TestMetadata("smartCastInInit.kt") public void testSmartCastInInit() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.kt"); } + @Test @TestMetadata("smartcastToNothing.kt") public void testSmartcastToNothing() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.kt"); } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Booleans extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Booleans extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInBooleans() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("booleanOperators.kt") public void testBooleanOperators() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt"); } + @Test @TestMetadata("equalsToBoolean.kt") public void testEqualsToBoolean() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt"); } + @Test @TestMetadata("jumpFromRhsOfOperator.kt") public void testJumpFromRhsOfOperator() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BoundSmartcasts extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class BoundSmartcasts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInBoundSmartcasts() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("boundSmartcasts.kt") public void testBoundSmartcasts() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt"); } + @Test @TestMetadata("boundSmartcastsInBranches.kt") public void testBoundSmartcastsInBranches() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt"); } + @Test @TestMetadata("functionCallBound.kt") public void testFunctionCallBound() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlStructures extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class ControlStructures extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInControlStructures() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("elvis.kt") public void testElvis() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.kt"); } + @Test @TestMetadata("returns.kt") public void testReturns() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt"); } + @Test @TestMetadata("simpleIf.kt") public void testSimpleIf() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.kt"); } + @Test @TestMetadata("smartcastFromArgument.kt") public void testSmartcastFromArgument() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Lambdas extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Lambdas extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInLambdas() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("inPlaceLambdas.kt") public void testInPlaceLambdas() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.kt"); } + @Test @TestMetadata("lambdaInWhenBranch.kt") public void testLambdaInWhenBranch() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.kt"); } + @Test @TestMetadata("smartcastOnLambda.kt") public void testSmartcastOnLambda() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Loops extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Loops extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInLoops() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("dataFlowInfoFromWhileCondition.kt") public void testDataFlowInfoFromWhileCondition() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.kt"); } + @Test @TestMetadata("endlessLoops.kt") public void testEndlessLoops() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Problems extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInProblems() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("invoke.kt") public void testInvoke() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems/invoke.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Receivers extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Receivers extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInReceivers() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("implicitReceiverAsWhenSubject.kt") public void testImplicitReceiverAsWhenSubject() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.kt"); } + @Test @TestMetadata("implicitReceivers.kt") public void testImplicitReceivers() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt"); } + @Test @TestMetadata("mixingImplicitAndExplicitReceivers.kt") public void testMixingImplicitAndExplicitReceivers() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/mixingImplicitAndExplicitReceivers.kt"); } + @Test @TestMetadata("thisOfExtensionProperty.kt") public void testThisOfExtensionProperty() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SafeCalls extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class SafeCalls extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInSafeCalls() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("assignSafeCall.kt") public void testAssignSafeCall() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.kt"); } + @Test @TestMetadata("boundSafeCallAndIsCheck.kt") public void testBoundSafeCallAndIsCheck() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/boundSafeCallAndIsCheck.kt"); } + @Test @TestMetadata("safeCallAndEqualityToBool.kt") public void testSafeCallAndEqualityToBool() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt"); } + @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Stability extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Stability extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInStability() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("overridenOpenVal.kt") public void testOverridenOpenVal() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Variables extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Variables extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInVariables() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("delayedAssignment.kt") public void testDelayedAssignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt"); } + @Test @TestMetadata("smartcastAfterReassignment.kt") public void testSmartcastAfterReassignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); @@ -2616,35 +2938,31 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/stdlib") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Stdlib extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Stdlib extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInStdlib() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/stdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class J_k extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class J_k extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInJ_k() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("ArrayInGenericArguments.kt") public void testArrayInGenericArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k/ArrayInGenericArguments.kt"); } + @Test @TestMetadata("flexibleWildcard.kt") public void testFlexibleWildcard() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k/flexibleWildcard.kt"); @@ -2652,91 +2970,98 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/types") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Types extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Types extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInTypes() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/types"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("bareWithSubjectTypeAlias.kt") public void testBareWithSubjectTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/types/bareWithSubjectTypeAlias.kt"); } + @Test @TestMetadata("capturedParametersOfInnerClasses.kt") public void testCapturedParametersOfInnerClasses() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt"); } } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/visibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Visibility extends AbstractFirDiagnosticsWithLightTreeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Visibility extends AbstractFirDiagnosticsWithLightTreeTest { + @Test public void testAllFilesPresentInVisibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/visibility"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test @TestMetadata("exposedFunctionParameterType.kt") public void testExposedFunctionParameterType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedFunctionParameterType.kt"); } + @Test @TestMetadata("exposedFunctionReturnType.kt") public void testExposedFunctionReturnType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedFunctionReturnType.kt"); } + @Test @TestMetadata("exposedPropertyType.kt") public void testExposedPropertyType() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedPropertyType.kt"); } + @Test @TestMetadata("exposedSupertype.kt") public void testExposedSupertype() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt"); } + @Test @TestMetadata("exposedTypeAlias.kt") public void testExposedTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedTypeAlias.kt"); } + @Test @TestMetadata("exposedTypeParameters.kt") public void testExposedTypeParameters() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedTypeParameters.kt"); } + @Test @TestMetadata("intersectionOverrideWithImplicitTypes.kt") public void testIntersectionOverrideWithImplicitTypes() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/intersectionOverrideWithImplicitTypes.kt"); } + @Test @TestMetadata("kotlinJavaKotlinHierarchy.kt") public void testKotlinJavaKotlinHierarchy() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/kotlinJavaKotlinHierarchy.kt"); } + @Test @TestMetadata("protectedInCompanion.kt") public void testProtectedInCompanion() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/protectedInCompanion.kt"); } + @Test @TestMetadata("singletonConstructors.kt") public void testSingletonConstructors() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt"); } + @Test @TestMetadata("visibilityWithOverrides.kt") public void testVisibilityWithOverrides() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/visibility/visibilityWithOverrides.kt"); diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/FirDiagnosticsDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/FirDiagnosticsDirectives.kt index 609cf5ba2a9..eee8d9c9544 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/FirDiagnosticsDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/FirDiagnosticsDirectives.kt @@ -24,4 +24,15 @@ object FirDiagnosticsDirectives : SimpleDirectivesContainer() { val FIR_IDENTICAL by directive( description = "Contents of fir test data file and FE 1.0 are identical" ) + + val USE_LIGHT_TREE by directive( + description = "Enables light tree parser instead of PSI" + ) + + val COMPARE_WITH_LIGHT_TREE by directive( + description = """ + Enable comparing diagnostics between PSI and light tree modes + For enabling light tree mode use $USE_LIGHT_TREE directive + """.trimIndent() + ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicDiagnosticReporter.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicDiagnosticReporter.kt index 6a67ae63292..2cf615f2da2 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicDiagnosticReporter.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicDiagnosticReporter.kt @@ -6,9 +6,7 @@ package org.jetbrains.kotlin.test.frontend.classic.handlers import org.jetbrains.kotlin.checkers.utils.DiagnosticsRenderingConfiguration -import org.jetbrains.kotlin.codeMetaInfo.model.CodeMetaInfo import org.jetbrains.kotlin.codeMetaInfo.model.DiagnosticCodeMetaInfo -import org.jetbrains.kotlin.codeMetaInfo.model.ParsedCodeMetaInfo import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.diagnostics.Diagnostic @@ -20,6 +18,7 @@ import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives import org.jetbrains.kotlin.test.model.TestFile import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.* +import org.jetbrains.kotlin.test.utils.AbstractTwoAttributesMetaInfoProcessor class ClassicDiagnosticReporter(private val testServices: TestServices) { private val globalMetadataInfoHandler: GlobalMetadataInfoHandler @@ -81,66 +80,21 @@ class ClassicDiagnosticReporter(private val testServices: TestServices) { } } -class OldNewInferenceMetaInfoProcessor(testServices: TestServices) : AdditionalMetaInfoProcessor(testServices) { +class OldNewInferenceMetaInfoProcessor(testServices: TestServices) : AbstractTwoAttributesMetaInfoProcessor(testServices) { companion object { const val OI = "OI" const val NI = "NI" } - override fun processMetaInfos(module: TestModule, file: TestFile) { - /* - * Rules for OI/NI attribute: - * ┌──────────┬──────┬──────┬──────────┐ - * │ │ OI │ NI │ nothing │ <- reported - * ├──────────┼──────┼──────┼──────────┤ - * │ nothing │ both │ both │ nothing │ - * │ OI │ OI │ both │ OI │ - * │ NI │ both │ NI │ NI │ - * │ both │ both │ both │ opposite │ <- OI if NI enabled in test and vice versa - * └──────────┴──────┴──────┴──────────┘ - * ^ existed - */ - if (!testServices.withNewInferenceModeEnabled()) return - val newInferenceEnabled = module.languageVersionSettings.supportsFeature(LanguageFeature.NewInference) - val (currentFlag, otherFlag) = when (newInferenceEnabled) { - true -> NI to OI - false -> OI to NI - } - val matchedExistedInfos = mutableSetOf() - val matchedReportedInfos = mutableSetOf() - val allReportedInfos = globalMetadataInfoHandler.getReportedMetaInfosForFile(file) - for ((_, reportedInfos) in allReportedInfos.groupBy { Triple(it.start, it.end, it.tag) }) { - val existedInfos = globalMetadataInfoHandler.getExistingMetaInfosForActualMetadata(file, reportedInfos.first()) - for ((reportedInfo, existedInfo) in reportedInfos.zip(existedInfos)) { - matchedExistedInfos += existedInfo - matchedReportedInfos += reportedInfo - if (currentFlag !in reportedInfo.attributes) continue - if (currentFlag in existedInfo.attributes) continue - reportedInfo.attributes.remove(currentFlag) - } - } + override val firstAttribute: String get() = NI + override val secondAttribute: String get() = OI - if (allReportedInfos.size != matchedReportedInfos.size) { - for (info in allReportedInfos) { - if (info !in matchedReportedInfos) { - info.attributes.remove(currentFlag) - } - } - } + override fun processorEnabled(module: TestModule): Boolean { + return DiagnosticsDirectives.WITH_NEW_INFERENCE in module.directives + } - val allExistedInfos = globalMetadataInfoHandler.getExistingMetaInfosForFile(file) - if (allExistedInfos.size == matchedExistedInfos.size) return - - val newInfos = allExistedInfos.mapNotNull { - if (it in matchedExistedInfos) return@mapNotNull null - if (currentFlag in it.attributes) return@mapNotNull null - it.copy().apply { - if (otherFlag !in attributes) { - attributes += otherFlag - } - } - } - globalMetadataInfoHandler.addMetadataInfosForFile(file, newInfos) + override fun firstAttributeEnabled(module: TestModule): Boolean { + return module.languageVersionSettings.supportsFeature(LanguageFeature.NewInference) } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFrontendFacade.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFrontendFacade.kt index 643bf466f67..7d4c1695559 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFrontendFacade.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFrontendFacade.kt @@ -16,8 +16,12 @@ import org.jetbrains.kotlin.fir.analysis.FirAnalyzerFacade import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider import org.jetbrains.kotlin.fir.session.FirJvmModuleInfo import org.jetbrains.kotlin.fir.session.FirSessionFactory +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer import org.jetbrains.kotlin.test.model.* import org.jetbrains.kotlin.test.services.* +import java.io.File class FirFrontendFacade( testServices: TestServices @@ -25,6 +29,9 @@ class FirFrontendFacade( override val additionalServices: List get() = listOf(service(::FirModuleInfoProvider)) + override val additionalDirectives: List + get() = listOf(FirDiagnosticsDirectives) + override fun analyze(module: TestModule): FirOutputArtifact { val moduleInfoProvider = testServices.firModuleInfoProvider val compilerConfigurationProvider = testServices.compilerConfigurationProvider @@ -34,7 +41,12 @@ class FirFrontendFacade( PsiElementFinder.EP.getPoint(project).unregisterExtension(JavaElementFinder::class.java) - val ktFiles = testServices.sourceFileProvider.getKtFilesForSourceFiles(module.files, project).values + val lightTreeEnabled = FirDiagnosticsDirectives.USE_LIGHT_TREE in module.directives + val (ktFiles, originalFiles) = if (lightTreeEnabled) { + emptyList() to module.files.filter { it.isKtFile }.map { testServices.sourceFileProvider.getRealFileForSourceFile(it) } + } else { + testServices.sourceFileProvider.getKtFilesForSourceFiles(module.files, project).values to emptyList() + } val sessionProvider = moduleInfoProvider.firSessionProvider @@ -55,7 +67,7 @@ class FirFrontendFacade( languageVersionSettings = languageVersionSettings ) - val firAnalyzerFacade = FirAnalyzerFacade(session, languageVersionSettings, ktFiles) + val firAnalyzerFacade = FirAnalyzerFacade(session, languageVersionSettings, ktFiles, originalFiles, lightTreeEnabled) val firFiles = firAnalyzerFacade.runResolution() val filesMap = firFiles.mapNotNull { firFile -> val testFile = module.files.firstOrNull { it.name == firFile.name } ?: return@mapNotNull null diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt index 5a9b08289b3..2d2fa173333 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt @@ -32,11 +32,13 @@ import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitorVoid import org.jetbrains.kotlin.name.FqNameUnsafe import org.jetbrains.kotlin.resolve.AnalyzingUtils import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives import org.jetbrains.kotlin.test.directives.model.DirectivesContainer import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact import org.jetbrains.kotlin.test.model.TestFile import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.* +import org.jetbrains.kotlin.test.utils.AbstractTwoAttributesMetaInfoProcessor import org.jetbrains.kotlin.util.OperatorNameConventions import org.jetbrains.kotlin.utils.addIfNotNull @@ -62,6 +64,8 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes override fun processModule(module: TestModule, info: FirOutputArtifact) { val diagnosticsPerFile = info.firAnalyzerFacade.runCheckers() + val lightTreeComparingModeEnabled = FirDiagnosticsDirectives.COMPARE_WITH_LIGHT_TREE in module.directives + val lightTreeEnabled = FirDiagnosticsDirectives.USE_LIGHT_TREE in module.directives for (file in module.files) { val firFile = info.firFiles[file] ?: continue @@ -71,29 +75,42 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes // SYNTAX errors will be reported later if (diagnostic.factory == FirErrors.SYNTAX) return@mapNotNull null if (!diagnostic.isValid) return@mapNotNull null - diagnostic.toMetaInfo(file) + diagnostic.toMetaInfo(file, lightTreeEnabled, lightTreeComparingModeEnabled) } globalMetadataInfoHandler.addMetadataInfosForFile(file, diagnosticsMetadataInfos) - collectSyntaxDiagnostics(file, firFile) - collectDebugInfoDiagnostics(file, firFile) + collectSyntaxDiagnostics(file, firFile, lightTreeEnabled, lightTreeComparingModeEnabled) + collectDebugInfoDiagnostics(file, firFile, lightTreeEnabled, lightTreeComparingModeEnabled) } } - private fun FirDiagnostic<*>.toMetaInfo(file: TestFile, forceRenderArguments: Boolean = false): FirDiagnosticCodeMetaInfo { + private fun FirDiagnostic<*>.toMetaInfo( + file: TestFile, + lightTreeEnabled: Boolean, + lightTreeComparingModeEnabled: Boolean, + forceRenderArguments: Boolean = false + ): FirDiagnosticCodeMetaInfo { val metaInfo = FirDiagnosticCodeMetaInfo(this, FirMetaInfoUtils.renderDiagnosticNoArgs) val shouldRenderArguments = forceRenderArguments || globalMetadataInfoHandler.getExistingMetaInfosForActualMetadata(file, metaInfo) .any { it.description != null } if (shouldRenderArguments) { metaInfo.replaceRenderConfiguration(FirMetaInfoUtils.renderDiagnosticWithArgs) } + if (lightTreeComparingModeEnabled) { + metaInfo.attributes += if (lightTreeEnabled) PsiLightTreeMetaInfoProcessor.LT else PsiLightTreeMetaInfoProcessor.PSI + } return metaInfo } - private fun collectSyntaxDiagnostics(testFile: TestFile, firFile: FirFile) { + private fun collectSyntaxDiagnostics( + testFile: TestFile, + firFile: FirFile, + lightTreeEnabled: Boolean, + lightTreeComparingModeEnabled: Boolean + ) { // TODO: support in light tree val psiFile = firFile.psi ?: return val metaInfos = AnalyzingUtils.getSyntaxErrorRanges(psiFile).map { - FirErrors.SYNTAX.on(FirRealPsiSourceElement(it)).toMetaInfo(testFile) + FirErrors.SYNTAX.on(FirRealPsiSourceElement(it)).toMetaInfo(testFile, lightTreeEnabled, lightTreeComparingModeEnabled) } globalMetadataInfoHandler.addMetadataInfosForFile(testFile, metaInfos) } @@ -101,6 +118,8 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes private fun collectDebugInfoDiagnostics( testFile: TestFile, firFile: FirFile, + lightTreeEnabled: Boolean, + lightTreeComparingModeEnabled: Boolean ) { val result = mutableListOf>() val diagnosedRangesToDiagnosticNames = globalMetadataInfoHandler.getExistingMetaInfosForFile(testFile).groupBy( @@ -128,7 +147,10 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes super.visitFunctionCall(functionCall) } }.let(firFile::accept) - globalMetadataInfoHandler.addMetadataInfosForFile(testFile, result.map { it.toMetaInfo(testFile, forceRenderArguments = true) }) + globalMetadataInfoHandler.addMetadataInfosForFile( + testFile, + result.map { it.toMetaInfo(testFile, lightTreeEnabled, lightTreeComparingModeEnabled, forceRenderArguments = true) } + ) } fun createExpressionTypeDiagnosticIfExpected( @@ -230,3 +252,21 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes override fun processAfterAllModules(someAssertionWasFailed: Boolean) {} } + +class PsiLightTreeMetaInfoProcessor(testServices: TestServices) : AbstractTwoAttributesMetaInfoProcessor(testServices) { + companion object { + const val PSI = "PSI" + const val LT = "LT" // Light Tree + } + + override val firstAttribute: String get() = PSI + override val secondAttribute: String get() = LT + + override fun processorEnabled(module: TestModule): Boolean { + return FirDiagnosticsDirectives.COMPARE_WITH_LIGHT_TREE in module.directives + } + + override fun firstAttributeEnabled(module: TestModule): Boolean { + return FirDiagnosticsDirectives.USE_LIGHT_TREE !in module.directives + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/GenerateNewCompilerTests.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/GenerateNewCompilerTests.kt index a9ea608954a..113823e1fe5 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/GenerateNewCompilerTests.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/GenerateNewCompilerTests.kt @@ -5,7 +5,7 @@ package org.jetbrains.kotlin.test.generators -import org.jetbrains.kotlin.generators.util.TestGeneratorUtil +import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.runners.* @@ -47,8 +47,12 @@ fun main(args: Array) { testGroup("compiler/tests-common-new/tests-gen", "compiler/fir/analysis-tests/testData") { testClass { - model("resolve", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME) - model("resolveWithStdlib", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME) + model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("resolveWithStdlib", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/impl/TestConfigurationImpl.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/impl/TestConfigurationImpl.kt index 164a0e9ca09..e82d9f6534e 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/impl/TestConfigurationImpl.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/impl/TestConfigurationImpl.kt @@ -123,7 +123,12 @@ class TestConfigurationImpl( init { testServices.apply { - this@TestConfigurationImpl.facades.values.forEach { it.values.forEach { facade -> register(facade.additionalServices) } } + this@TestConfigurationImpl.facades.values.forEach { + it.values.forEach { facade -> + register(facade.additionalServices) + allDirectives += facade.additionalDirectives + } + } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt index f44723c4ba6..f5497d17639 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt @@ -8,7 +8,11 @@ package org.jetbrains.kotlin.test.runners import org.jetbrains.kotlin.platform.jvm.JvmPlatforms import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.COMPARE_WITH_LIGHT_TREE +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.FIR_DUMP +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.USE_LIGHT_TREE import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_STDLIB import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives import org.jetbrains.kotlin.test.frontend.fir.FirFailingTestSuppressor import org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade @@ -45,6 +49,8 @@ abstract class AbstractFirDiagnosticTest : AbstractKotlinCompilerTest() { ::FirCfgConsistencyHandler, ) + useMetaInfoProcessors(::PsiLightTreeMetaInfoProcessor) + forTestsMatching("compiler/testData/diagnostics/*") { useAfterAnalysisCheckers( ::FirIdenticalChecker, @@ -55,7 +61,8 @@ abstract class AbstractFirDiagnosticTest : AbstractKotlinCompilerTest() { forTestsMatching("compiler/fir/analysis-tests/testData/*") { defaultDirectives { - +FirDiagnosticsDirectives.FIR_DUMP + +FIR_DUMP + +COMPARE_WITH_LIGHT_TREE } } @@ -65,7 +72,18 @@ abstract class AbstractFirDiagnosticTest : AbstractKotlinCompilerTest() { "compiler/testData/diagnostics/tests/unsignedTypes/*" ) { defaultDirectives { - +JvmEnvironmentConfigurationDirectives.WITH_STDLIB + +WITH_STDLIB + } + } + } +} + +abstract class AbstractFirDiagnosticsWithLightTreeTest : AbstractFirDiagnosticTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + with(builder) { + defaultDirectives { + +USE_LIGHT_TREE } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/AbstractTwoAttributesMetaInfoProcessor.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/AbstractTwoAttributesMetaInfoProcessor.kt new file mode 100644 index 00000000000..906b0c27a85 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/AbstractTwoAttributesMetaInfoProcessor.kt @@ -0,0 +1,76 @@ +/* + * Copyright 2010-2020 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.codeMetaInfo.model.CodeMetaInfo +import org.jetbrains.kotlin.codeMetaInfo.model.ParsedCodeMetaInfo +import org.jetbrains.kotlin.test.model.TestFile +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.AdditionalMetaInfoProcessor +import org.jetbrains.kotlin.test.services.TestServices + +abstract class AbstractTwoAttributesMetaInfoProcessor(testServices: TestServices) : AdditionalMetaInfoProcessor(testServices) { + protected abstract val firstAttribute: String + protected abstract val secondAttribute: String + + protected abstract fun processorEnabled(module: TestModule): Boolean + protected abstract fun firstAttributeEnabled(module: TestModule): Boolean + + override fun processMetaInfos(module: TestModule, file: TestFile) { + /* + * Rules for OI/NI attribute: + * ┌──────────┬───────┬────────┬──────────┐ + * │ │ first │ second │ nothing │ <- reported + * ├──────────┼───────┼────────┼──────────┤ + * │ nothing │ both │ both │ nothing │ + * │ first │ first │ both │ first │ + * │ second │ both │ second │ second │ + * │ both │ both │ both │ opposite │ <- first if second enabled in test and vice versa + * └──────────┴───────┴────────┴──────────┘ + * ^ existed + */ + if (!processorEnabled(module)) return + val (currentFlag, otherFlag) = when (firstAttributeEnabled(module)) { + true -> firstAttribute to secondAttribute + false -> secondAttribute to firstAttribute + } + val matchedExistedInfos = mutableSetOf() + val matchedReportedInfos = mutableSetOf() + val allReportedInfos = globalMetadataInfoHandler.getReportedMetaInfosForFile(file) + for ((_, reportedInfos) in allReportedInfos.groupBy { Triple(it.start, it.end, it.tag) }) { + val existedInfos = globalMetadataInfoHandler.getExistingMetaInfosForActualMetadata(file, reportedInfos.first()) + for ((reportedInfo, existedInfo) in reportedInfos.zip(existedInfos)) { + matchedExistedInfos += existedInfo + matchedReportedInfos += reportedInfo + if (currentFlag !in reportedInfo.attributes) continue + if (currentFlag in existedInfo.attributes) continue + reportedInfo.attributes.remove(currentFlag) + } + } + + if (allReportedInfos.size != matchedReportedInfos.size) { + for (info in allReportedInfos) { + if (info !in matchedReportedInfos) { + info.attributes.remove(currentFlag) + } + } + } + + val allExistedInfos = globalMetadataInfoHandler.getExistingMetaInfosForFile(file) + if (allExistedInfos.size == matchedExistedInfos.size) return + + val newInfos = allExistedInfos.mapNotNull { + if (it in matchedExistedInfos) return@mapNotNull null + if (currentFlag in it.attributes) return@mapNotNull null + it.copy().apply { + if (otherFlag !in attributes) { + attributes += otherFlag + } + } + } + globalMetadataInfoHandler.addMetadataInfosForFile(file, newInfos) + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index e9b03e95d04..8bad7ab7bbe 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -603,14 +603,9 @@ fun main(args: Array) { } testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") { - testClass { - model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) } - } testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/testData") {