From 1c6da8b9b447ea9735a225b79a2bef34c3572f39 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 18 Dec 2019 14:15:23 +0300 Subject: [PATCH] [FIR] Add separate diagnostic tests working in light tree mode Now we have separate raw fir builder based and light tree builder based tests. Note: one light tree test was ignored due to lack of JavaElementFinder in this mode. --- .../resolve/samConversions/samWithEquals.kt | 2 + .../fir/AbstractFirBaseDiagnosticsTest.kt | 33 +- ...AbstractFirDiagnosticsWithLightTreeTest.kt | 24 + .../fir/FirDiagnosticsTestLightTreeHelper.kt | 23 + ...DiagnosticsWithLightTreeTestGenerated.java | 1133 +++++++++++++++++ .../generators/tests/GenerateCompilerTests.kt | 4 + 6 files changed, 1208 insertions(+), 11 deletions(-) create mode 100644 compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt create mode 100644 compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestLightTreeHelper.kt create mode 100644 compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java diff --git a/compiler/fir/resolve/testData/resolve/samConversions/samWithEquals.kt b/compiler/fir/resolve/testData/resolve/samConversions/samWithEquals.kt index 700146897ee..c494bbc21af 100644 --- a/compiler/fir/resolve/testData/resolve/samConversions/samWithEquals.kt +++ b/compiler/fir/resolve/testData/resolve/samConversions/samWithEquals.kt @@ -1,3 +1,5 @@ +// IGNORE_LIGHT_TREE +// Does not work in light tree mode due to lack of Java element finder there // FILE: KotlinTypeChecker.java public interface KotlinTypeChecker { diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt index 43dc083dc65..7f17e36ed10 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt @@ -28,6 +28,7 @@ import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.java.FirJavaModuleBasedSession import org.jetbrains.kotlin.fir.java.FirLibrarySession import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider +import org.jetbrains.kotlin.fir.lightTree.LightTree2Fir import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeDiagnostic import org.jetbrains.kotlin.fir.resolve.firProvider import org.jetbrains.kotlin.fir.resolve.impl.FirProviderImpl @@ -35,6 +36,7 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.platform.TargetPlatform import org.jetbrains.kotlin.platform.jvm.JvmPlatforms +import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.resolve.AnalyzingUtils import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices @@ -60,7 +62,7 @@ abstract class AbstractFirBaseDiagnosticsTest : BaseDiagnosticsTest() { } } - protected open fun analyzeAndCheckUnhandled(testDataFile: File, files: List) { + open fun analyzeAndCheckUnhandled(testDataFile: File, files: List, useLightTree: Boolean = false) { val groupedByModule = files.groupBy(TestFile::module) val modules = createModules(groupedByModule) @@ -90,21 +92,30 @@ abstract class AbstractFirBaseDiagnosticsTest : BaseDiagnosticsTest() { val session = configToSession.getValue(testModule) - - val firBuilder = RawFirBuilder(session, false) - - ktFiles.mapTo(firFiles) { - val firFile = firBuilder.buildFirFile(it) - - (session.firProvider as FirProviderImpl).recordFile(firFile) - - firFile - } + mapKtFilesToFirFiles(session, ktFiles, firFiles, useLightTree) } runAnalysis(testDataFile, files, firFiles) } + private fun mapKtFilesToFirFiles(session: FirSession, ktFiles: List, firFiles: MutableList, useLightTree: Boolean) { + if (useLightTree) { + val lightTreeBuilder = LightTree2Fir(session, stubMode = false) + ktFiles.mapTo(firFiles) { + val firFile = lightTreeBuilder.buildFirFile(it.text, it.name) + (session.firProvider as FirProviderImpl).recordFile(firFile) + firFile + } + } else { + val firBuilder = RawFirBuilder(session, false) + ktFiles.mapTo(firFiles) { + val firFile = firBuilder.buildFirFile(it) + (session.firProvider as FirProviderImpl).recordFile(firFile) + firFile + } + } + } + protected abstract fun runAnalysis(testDataFile: File, testFiles: List, firFiles: List) private fun createModules( diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt new file mode 100644 index 00000000000..1a29c3ebc01 --- /dev/null +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir + +import org.jetbrains.kotlin.test.InTextDirectivesUtils +import org.jetbrains.kotlin.test.KotlinTestUtils +import java.io.File + +abstract class AbstractFirDiagnosticsWithLightTreeTest : AbstractFirDiagnosticsTest(), FirDiagnosticsTestLightTreeHelper { + override fun doTest(filePath: String) { + val file = createTestFileFromPath(filePath) + val expectedText = KotlinTestUtils.doLoadFile(file) + if (InTextDirectivesUtils.isDirectiveDefined(expectedText, "// IGNORE_LIGHT_TREE")) return + + super.doTest(filePath) + } + + override fun analyzeAndCheck(testDataFile: File, files: List) { + super.analyzeAndCheck(testDataFile, files) + } +} \ No newline at end of file diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestLightTreeHelper.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestLightTreeHelper.kt new file mode 100644 index 00000000000..1b097b15225 --- /dev/null +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestLightTreeHelper.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir + +import org.jetbrains.kotlin.checkers.BaseDiagnosticsTest +import java.io.File + +interface FirDiagnosticsTestLightTreeHelper { + fun analyzeAndCheck(testDataFile: File, files: List) { + try { + analyzeAndCheckUnhandled(testDataFile, files, useLightTree = true) + } catch (t: AssertionError) { + throw t + } catch (t: Throwable) { + throw t + } + } + + fun analyzeAndCheckUnhandled(testDataFile: File, files: List, useLightTree: Boolean) +} \ No newline at end of file diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java new file mode 100644 index 00000000000..4cd195cd088 --- /dev/null +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +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 */ +@SuppressWarnings("all") +@TestMetadata("compiler/fir/resolve/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); + } + + public void testAllFilesPresentInResolve() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "stdlib", "cfg", "smartcasts"); + } + + @TestMetadata("cast.kt") + public void testCast() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/cast.kt"); + } + + @TestMetadata("companion.kt") + public void testCompanion() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/companion.kt"); + } + + @TestMetadata("companionUsesNested.kt") + public void testCompanionUsesNested() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/companionUsesNested.kt"); + } + + @TestMetadata("copy.kt") + public void testCopy() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/copy.kt"); + } + + @TestMetadata("delegatedSuperType.kt") + public void testDelegatedSuperType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/delegatedSuperType.kt"); + } + + @TestMetadata("delegatingConstructorCall.kt") + public void testDelegatingConstructorCall() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/delegatingConstructorCall.kt"); + } + + @TestMetadata("delegatingConstructorsAndTypeAliases.kt") + public void testDelegatingConstructorsAndTypeAliases() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/delegatingConstructorsAndTypeAliases.kt"); + } + + @TestMetadata("derivedClass.kt") + public void testDerivedClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/derivedClass.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/enum.kt"); + } + + @TestMetadata("enumWithCompanion.kt") + public void testEnumWithCompanion() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/enumWithCompanion.kt"); + } + + @TestMetadata("exhaustiveness_boolean.kt") + public void testExhaustiveness_boolean() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/exhaustiveness_boolean.kt"); + } + + @TestMetadata("exhaustiveness_enum.kt") + public void testExhaustiveness_enum() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/exhaustiveness_enum.kt"); + } + + @TestMetadata("exhaustiveness_sealedClass.kt") + public void testExhaustiveness_sealedClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/exhaustiveness_sealedClass.kt"); + } + + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/extension.kt"); + } + + @TestMetadata("F.kt") + public void testF() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/F.kt"); + } + + @TestMetadata("fakeRecursiveSupertype.kt") + public void testFakeRecursiveSupertype() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fakeRecursiveSupertype.kt"); + } + + @TestMetadata("fakeRecursiveTypealias.kt") + public void testFakeRecursiveTypealias() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fakeRecursiveTypealias.kt"); + } + + @TestMetadata("fib.kt") + public void testFib() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fib.kt"); + } + + @TestMetadata("ft.kt") + public void testFt() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/ft.kt"); + } + + @TestMetadata("functionTypes.kt") + public void testFunctionTypes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/functionTypes.kt"); + } + + @TestMetadata("genericConstructors.kt") + public void testGenericConstructors() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/genericConstructors.kt"); + } + + @TestMetadata("genericFunctions.kt") + public void testGenericFunctions() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/genericFunctions.kt"); + } + + @TestMetadata("intersectionTypes.kt") + public void testIntersectionTypes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/intersectionTypes.kt"); + } + + @TestMetadata("localObject.kt") + public void testLocalObject() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/localObject.kt"); + } + + @TestMetadata("nestedClass.kt") + public void testNestedClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/nestedClass.kt"); + } + + @TestMetadata("nestedClassNameClash.kt") + public void testNestedClassNameClash() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/nestedClassNameClash.kt"); + } + + @TestMetadata("NestedOfAliasedType.kt") + public void testNestedOfAliasedType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/NestedOfAliasedType.kt"); + } + + @TestMetadata("nestedReturnType.kt") + public void testNestedReturnType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/nestedReturnType.kt"); + } + + @TestMetadata("NestedSuperType.kt") + public void testNestedSuperType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/NestedSuperType.kt"); + } + + @TestMetadata("problems2.kt") + public void testProblems2() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems2.kt"); + } + + @TestMetadata("recursiveCallOnWhenWithSealedClass.kt") + public void testRecursiveCallOnWhenWithSealedClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/recursiveCallOnWhenWithSealedClass.kt"); + } + + @TestMetadata("simpleClass.kt") + public void testSimpleClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/simpleClass.kt"); + } + + @TestMetadata("simpleTypeAlias.kt") + public void testSimpleTypeAlias() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/simpleTypeAlias.kt"); + } + + @TestMetadata("treeSet.kt") + public void testTreeSet() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/treeSet.kt"); + } + + @TestMetadata("tryInference.kt") + public void testTryInference() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/tryInference.kt"); + } + + @TestMetadata("TwoDeclarationsInSameFile.kt") + public void testTwoDeclarationsInSameFile() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/TwoDeclarationsInSameFile.kt"); + } + + @TestMetadata("typeAliasWithGeneric.kt") + public void testTypeAliasWithGeneric() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/typeAliasWithGeneric.kt"); + } + + @TestMetadata("typeAliasWithTypeArguments.kt") + public void testTypeAliasWithTypeArguments() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/typeAliasWithTypeArguments.kt"); + } + + @TestMetadata("typeFromGetter.kt") + public void testTypeFromGetter() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/typeFromGetter.kt"); + } + + @TestMetadata("typeParameterInPropertyReceiver.kt") + public void testTypeParameterInPropertyReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/typeParameterInPropertyReceiver.kt"); + } + + @TestMetadata("typeParameterVsNested.kt") + public void testTypeParameterVsNested() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/typeParameterVsNested.kt"); + } + + @TestMetadata("whenAsReceiver.kt") + public void testWhenAsReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/whenAsReceiver.kt"); + } + + @TestMetadata("whenInference.kt") + public void testWhenInference() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/whenInference.kt"); + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInArguments() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/arguments"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("ambiguityOnJavaOverride.kt") + public void testAmbiguityOnJavaOverride() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/ambiguityOnJavaOverride.kt"); + } + + @TestMetadata("default.kt") + public void testDefault() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/default.kt"); + } + + @TestMetadata("defaultFromOverrides.kt") + public void testDefaultFromOverrides() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/defaultFromOverrides.kt"); + } + + @TestMetadata("fieldPlusAssign.kt") + public void testFieldPlusAssign() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/fieldPlusAssign.kt"); + } + + @TestMetadata("incorrectFunctionalType.kt") + public void testIncorrectFunctionalType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/incorrectFunctionalType.kt"); + } + + @TestMetadata("integerLiteralTypes.kt") + public void testIntegerLiteralTypes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/integerLiteralTypes.kt"); + } + + @TestMetadata("invoke.kt") + public void testInvoke() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/invoke.kt"); + } + + @TestMetadata("javaArrayVariance.kt") + public void testJavaArrayVariance() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/javaArrayVariance.kt"); + } + + @TestMetadata("lambda.kt") + public void testLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/lambda.kt"); + } + + @TestMetadata("lambdaInLambda.kt") + public void testLambdaInLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.kt"); + } + + @TestMetadata("lambdaInLambda2.kt") + public void testLambdaInLambda2() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.kt"); + } + + @TestMetadata("lambdaInUnresolvedCall.kt") + public void testLambdaInUnresolvedCall() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/lambdaInUnresolvedCall.kt"); + } + + @TestMetadata("operatorsOverLiterals.kt") + public void testOperatorsOverLiterals() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/operatorsOverLiterals.kt"); + } + + @TestMetadata("overloadByReceiver.kt") + public void testOverloadByReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/overloadByReceiver.kt"); + } + + @TestMetadata("overloadWithDefault.kt") + public void testOverloadWithDefault() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/overloadWithDefault.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/simple.kt"); + } + + @TestMetadata("stringTemplates.kt") + public void testStringTemplates() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/stringTemplates.kt"); + } + + @TestMetadata("tryInLambda.kt") + public void testTryInLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/tryInLambda.kt"); + } + + @TestMetadata("vararg.kt") + public void testVararg() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/vararg.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInBuiltins() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/builtins"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("lists.kt") + public void testLists() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/builtins/lists.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInDiagnostics() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/diagnostics"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("infixFunctions.kt") + public void testInfixFunctions() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/diagnostics/infixFunctions.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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); + } + + @TestMetadata("access.kt") + public void testAccess() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/access.kt"); + } + + public void testAllFilesPresentInExpresssions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/expresssions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("annotationWithReturn.kt") + public void testAnnotationWithReturn() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/annotationWithReturn.kt"); + } + + @TestMetadata("annotations.kt") + public void testAnnotations() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/annotations.kt"); + } + + @TestMetadata("checkArguments.kt") + public void testCheckArguments() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/checkArguments.kt"); + } + + @TestMetadata("companion.kt") + public void testCompanion() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/companion.kt"); + } + + @TestMetadata("companionExtension.kt") + public void testCompanionExtension() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/companionExtension.kt"); + } + + @TestMetadata("constructor.kt") + public void testConstructor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/constructor.kt"); + } + + @TestMetadata("dispatchReceiver.kt") + public void testDispatchReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/dispatchReceiver.kt"); + } + + @TestMetadata("enumValues.kt") + public void testEnumValues() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/enumValues.kt"); + } + + @TestMetadata("extensionPropertyInLambda.kt") + public void testExtensionPropertyInLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/extensionPropertyInLambda.kt"); + } + + @TestMetadata("genericDecorator.kt") + public void testGenericDecorator() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/genericDecorator.kt"); + } + + @TestMetadata("genericDescriptor.kt") + public void testGenericDescriptor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/genericDescriptor.kt"); + } + + @TestMetadata("genericDiagnostic.kt") + public void testGenericDiagnostic() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.kt"); + } + + @TestMetadata("genericPropertyAccess.kt") + public void testGenericPropertyAccess() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/genericPropertyAccess.kt"); + } + + @TestMetadata("genericUsedInFunction.kt") + public void testGenericUsedInFunction() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/genericUsedInFunction.kt"); + } + + @TestMetadata("importedReceiver.kt") + public void testImportedReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.kt"); + } + + @TestMetadata("lambda.kt") + public void testLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/lambda.kt"); + } + + @TestMetadata("lambdaWithReceiver.kt") + public void testLambdaWithReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/lambdaWithReceiver.kt"); + } + + @TestMetadata("localConstructor.kt") + public void testLocalConstructor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localConstructor.kt"); + } + + @TestMetadata("localExtension.kt") + public void testLocalExtension() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localExtension.kt"); + } + + @TestMetadata("localImplicitBodies.kt") + public void testLocalImplicitBodies() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localImplicitBodies.kt"); + } + + @TestMetadata("localInnerClass.kt") + public void testLocalInnerClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localInnerClass.kt"); + } + + @TestMetadata("localObjects.kt") + public void testLocalObjects() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localObjects.kt"); + } + + @TestMetadata("localScopes.kt") + public void testLocalScopes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localScopes.kt"); + } + + @TestMetadata("localTypes.kt") + public void testLocalTypes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localTypes.kt"); + } + + @TestMetadata("localWithBooleanNot.kt") + public void testLocalWithBooleanNot() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/localWithBooleanNot.kt"); + } + + @TestMetadata("memberExtension.kt") + public void testMemberExtension() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/memberExtension.kt"); + } + + @TestMetadata("nestedVisibility.kt") + public void testNestedVisibility() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/nestedVisibility.kt"); + } + + @TestMetadata("objectVsProperty.kt") + public void testObjectVsProperty() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/objectVsProperty.kt"); + } + + @TestMetadata("objects.kt") + public void testObjects() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/objects.kt"); + } + + @TestMetadata("outerObject.kt") + public void testOuterObject() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/outerObject.kt"); + } + + @TestMetadata("overriddenJavaGetter.kt") + public void testOverriddenJavaGetter() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/overriddenJavaGetter.kt"); + } + + @TestMetadata("privateObjectLiteral.kt") + public void testPrivateObjectLiteral() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/privateObjectLiteral.kt"); + } + + @TestMetadata("privateVisibility.kt") + public void testPrivateVisibility() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/privateVisibility.kt"); + } + + @TestMetadata("protectedVisibility.kt") + public void testProtectedVisibility() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/protectedVisibility.kt"); + } + + @TestMetadata("qualifiedExpressions.kt") + public void testQualifiedExpressions() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/qualifiedExpressions.kt"); + } + + @TestMetadata("receiverConsistency.kt") + public void testReceiverConsistency() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/receiverConsistency.kt"); + } + + @TestMetadata("sameReceiver.kt") + public void testSameReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/sameReceiver.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/simple.kt"); + } + + @TestMetadata("this.kt") + public void testThis() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/this.kt"); + } + + @TestMetadata("typeAliasConstructor.kt") + public void testTypeAliasConstructor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/typeAliasConstructor.kt"); + } + + @TestMetadata("vararg.kt") + public void testVararg() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/vararg.kt"); + } + + @TestMetadata("when.kt") + public void testWhen() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/when.kt"); + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInInference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/expresssions/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("id.kt") + public void testId() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/inference/id.kt"); + } + + @TestMetadata("typeParameters.kt") + public void testTypeParameters() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters.kt"); + } + + @TestMetadata("typeParameters2.kt") + public void testTypeParameters2() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters2.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInInvoke() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/expresssions/invoke"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("explicitReceiver.kt") + public void testExplicitReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver.kt"); + } + + @TestMetadata("explicitReceiver2.kt") + public void testExplicitReceiver2() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver2.kt"); + } + + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/extension.kt"); + } + + @TestMetadata("farInvokeExtension.kt") + public void testFarInvokeExtension() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/farInvokeExtension.kt"); + } + + @TestMetadata("implicitTypeOrder.kt") + public void testImplicitTypeOrder() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/implicitTypeOrder.kt"); + } + + @TestMetadata("propertyFromParameter.kt") + public void testPropertyFromParameter() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/propertyFromParameter.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/simple.kt"); + } + + @TestMetadata("threeReceivers.kt") + public void testThreeReceivers() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/threeReceivers.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInOperators() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/expresssions/operators"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("plus.kt") + public void testPlus() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/operators/plus.kt"); + } + + @TestMetadata("plusAndPlusAssign.kt") + public void testPlusAndPlusAssign() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.kt"); + } + + @TestMetadata("plusAssign.kt") + public void testPlusAssign() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/expresssions/operators/plusAssign.kt"); + } + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInFromBuilder() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/fromBuilder"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("complexTypes.kt") + public void testComplexTypes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fromBuilder/complexTypes.kt"); + } + + @TestMetadata("enums.kt") + public void testEnums() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fromBuilder/enums.kt"); + } + + @TestMetadata("noPrimaryConstructor.kt") + public void testNoPrimaryConstructor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fromBuilder/noPrimaryConstructor.kt"); + } + + @TestMetadata("simpleClass.kt") + public void testSimpleClass() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fromBuilder/simpleClass.kt"); + } + + @TestMetadata("typeParameters.kt") + public void testTypeParameters() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/fromBuilder/typeParameters.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInInference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("receiverWithCapturedType.kt") + public void testReceiverWithCapturedType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/inference/receiverWithCapturedType.kt"); + } + + @TestMetadata("simpleCapturedTypes.kt") + public void testSimpleCapturedTypes() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/inference/simpleCapturedTypes.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInMultifile() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/multifile"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("Annotations.kt") + public void testAnnotations() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/Annotations.kt"); + } + + @TestMetadata("ByteArray.kt") + public void testByteArray() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/ByteArray.kt"); + } + + @TestMetadata("importFromObject.kt") + public void testImportFromObject() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/importFromObject.kt"); + } + + @TestMetadata("NestedSuperType.kt") + public void testNestedSuperType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/NestedSuperType.kt"); + } + + @TestMetadata("sealedStarImport.kt") + public void testSealedStarImport() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/sealedStarImport.kt"); + } + + @TestMetadata("simpleAliasedImport.kt") + public void testSimpleAliasedImport() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/simpleAliasedImport.kt"); + } + + @TestMetadata("simpleImport.kt") + public void testSimpleImport() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/simpleImport.kt"); + } + + @TestMetadata("simpleImportNested.kt") + public void testSimpleImportNested() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/simpleImportNested.kt"); + } + + @TestMetadata("simpleImportOuter.kt") + public void testSimpleImportOuter() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/simpleImportOuter.kt"); + } + + @TestMetadata("simpleStarImport.kt") + public void testSimpleStarImport() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/simpleStarImport.kt"); + } + + @TestMetadata("TypeAliasExpansion.kt") + public void testTypeAliasExpansion() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/multifile/TypeAliasExpansion.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/testData/resolve/nested") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Nested extends AbstractFirDiagnosticsWithLightTreeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInNested() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/nested"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("inner.kt") + public void testInner() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/nested/inner.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/nested/simple.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInOverrides() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/overrides"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("generics.kt") + public void testGenerics() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/generics.kt"); + } + + @TestMetadata("protobufExt.kt") + public void testProtobufExt() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/protobufExt.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/simple.kt"); + } + + @TestMetadata("simpleFakeOverride.kt") + public void testSimpleFakeOverride() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/simpleFakeOverride.kt"); + } + + @TestMetadata("simpleMostSpecific.kt") + public void testSimpleMostSpecific() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/simpleMostSpecific.kt"); + } + + @TestMetadata("supertypeGenerics.kt") + public void testSupertypeGenerics() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/supertypeGenerics.kt"); + } + + @TestMetadata("supertypeGenericsComplex.kt") + public void testSupertypeGenericsComplex() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/supertypeGenericsComplex.kt"); + } + + @TestMetadata("three.kt") + public void testThree() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/overrides/three.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInProblems() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("asImports.kt") + public void testAsImports() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/asImports.kt"); + } + + @TestMetadata("covariantArrayAsReceiver.kt") + public void testCovariantArrayAsReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/covariantArrayAsReceiver.kt"); + } + + @TestMetadata("defaultJavaImportHiding.kt") + public void testDefaultJavaImportHiding() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/defaultJavaImportHiding.kt"); + } + + @TestMetadata("definitelyNotNullAmbiguity.kt") + public void testDefinitelyNotNullAmbiguity() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAmbiguity.kt"); + } + + @TestMetadata("invokeOfLambdaWithReceiver.kt") + public void testInvokeOfLambdaWithReceiver() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/invokeOfLambdaWithReceiver.kt"); + } + + @TestMetadata("javaAccessorConversion.kt") + public void testJavaAccessorConversion() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt"); + } + + @TestMetadata("javaFieldVsAccessor.kt") + public void testJavaFieldVsAccessor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/javaFieldVsAccessor.kt"); + } + + @TestMetadata("javaStaticScopeInheritance.kt") + public void testJavaStaticScopeInheritance() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/javaStaticScopeInheritance.kt"); + } + + @TestMetadata("localFunctionsHiding.kt") + public void testLocalFunctionsHiding() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/localFunctionsHiding.kt"); + } + + @TestMetadata("nestedClassContructor.kt") + public void testNestedClassContructor() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/nestedClassContructor.kt"); + } + + @TestMetadata("noSmartcast.kt") + public void testNoSmartcast() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/noSmartcast.kt"); + } + + @TestMetadata("propertyFromJavaPlusAssign.kt") + public void testPropertyFromJavaPlusAssign() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/propertyFromJavaPlusAssign.kt"); + } + + @TestMetadata("samConversionInConstructorCall.kt") + public void testSamConversionInConstructorCall() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.kt"); + } + + @TestMetadata("syntheticsVsNormalProperties.kt") + public void testSyntheticsVsNormalProperties() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/problems/syntheticsVsNormalProperties.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInReferences() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/references"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/references/simple.kt"); + } + + @TestMetadata("superMember.kt") + public void testSuperMember() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/references/superMember.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInSamConstructors() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/samConstructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("genericSam.kt") + public void testGenericSam() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConstructors/genericSam.kt"); + } + + @TestMetadata("genericSamInferenceFromExpectType.kt") + public void testGenericSamInferenceFromExpectType() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt"); + } + + @TestMetadata("kotlinSam.kt") + public void testKotlinSam() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConstructors/kotlinSam.kt"); + } + + @TestMetadata("realConstructorFunction.kt") + public void testRealConstructorFunction() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConstructors/realConstructorFunction.kt"); + } + + @TestMetadata("runnable.kt") + public void testRunnable() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConstructors/runnable.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConstructors/simple.kt"); + } + } + + @TestMetadata("compiler/fir/resolve/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 void testAllFilesPresentInSamConversions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/samConversions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("genericSam.kt") + public void testGenericSam() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/genericSam.kt"); + } + + @TestMetadata("kotlinSam.kt") + public void testKotlinSam() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/kotlinSam.kt"); + } + + @TestMetadata("notSamBecauseOfSupertype.kt") + public void testNotSamBecauseOfSupertype() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/notSamBecauseOfSupertype.kt"); + } + + @TestMetadata("runnable.kt") + public void testRunnable() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/runnable.kt"); + } + + @TestMetadata("samSupertype.kt") + public void testSamSupertype() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/samSupertype.kt"); + } + + @TestMetadata("samSupertypeWithOverride.kt") + public void testSamSupertypeWithOverride() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/samSupertypeWithOverride.kt"); + } + + @TestMetadata("samWithEquals.kt") + public void testSamWithEquals() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/samWithEquals.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/samConversions/simple.kt"); + } + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index f11329c3327..da215330227 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -531,6 +531,10 @@ fun main(args: Array) { model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME, excludeDirs = listOf("stdlib", "cfg", "smartcasts")) } + testClass { + model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME, excludeDirs = listOf("stdlib", "cfg", "smartcasts")) + } + testClass { model("resolve/cfg", pattern = KT_WITHOUT_DOTS_IN_NAME) model("resolve/smartcasts", pattern = KT_WITHOUT_DOTS_IN_NAME)