[AA] Tests: Remove decompiled files from LibraryBinary and add LibraryBinaryDecompiled
- `LibraryBinary` should not contain any decompiled files, as we want FIR symbols in tests to be provided from indexed stubs or class files, but definitely not from decompiled PSI. This brings `LibraryBinary` much closer to the behavior of binary libraries in the IDE. - Some tests may still require access to a decompiled file, for example when trying to test `getOrBuildFir` for some `KtElement` coming from a library. This commit introduces `LibraryBinaryDecompiled`, which does contain decompiled files. - We don't really need `LibraryBinary` as a main test module kind anymore, since tests generally want to access some main `KtFile`. Hence, test configurators for `LibraryBinary` have been turned into configurators for `LibraryBinaryDecompiled`. - An alternative would be decompiling files on demand, but this is not currently feasible because the Standalone API doesn't reconcile stubs with decompiled PSI, like the IDE does automatically. (For the same declaration, the stub and the PSI will have a different identity.) As long as there is no support for this, we'll have to rely on a separate test module kind. ^KT-65960
This commit is contained in:
committed by
Space Team
parent
7baaa38b8a
commit
78ef58bef4
+1
@@ -35,6 +35,7 @@ object AnalysisApiFe10TestConfiguratorFactory : AnalysisApiTestConfiguratorFacto
|
||||
|
||||
TestModuleKind.ScriptSource,
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibraryBinaryDecompiled,
|
||||
TestModuleKind.LibrarySource,
|
||||
TestModuleKind.CodeFragment,
|
||||
TestModuleKind.NotUnderContentRoot -> {
|
||||
|
||||
+5
-4
@@ -6,7 +6,7 @@
|
||||
package org.jetbrains.kotlin.analysis.api.fir.test.configurators
|
||||
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirCodeFragmentTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryDecompiledTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibrarySourceTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirScriptTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirSourceTestConfigurator
|
||||
@@ -27,9 +27,9 @@ object AnalysisApiFirTestConfiguratorFactory : AnalysisApiTestConfiguratorFactor
|
||||
AnalysisSessionMode.Dependent -> AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = true)
|
||||
}
|
||||
|
||||
TestModuleKind.LibraryBinary -> {
|
||||
TestModuleKind.LibraryBinaryDecompiled -> {
|
||||
require(data.analysisSessionMode == AnalysisSessionMode.Normal)
|
||||
AnalysisApiFirLibraryBinaryTestConfigurator
|
||||
AnalysisApiFirLibraryBinaryDecompiledTestConfigurator
|
||||
}
|
||||
|
||||
TestModuleKind.LibrarySource -> {
|
||||
@@ -56,12 +56,13 @@ object AnalysisApiFirTestConfiguratorFactory : AnalysisApiTestConfiguratorFactor
|
||||
true
|
||||
}
|
||||
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibraryBinaryDecompiled,
|
||||
TestModuleKind.LibrarySource,
|
||||
TestModuleKind.CodeFragment -> {
|
||||
data.analysisSessionMode == AnalysisSessionMode.Normal
|
||||
}
|
||||
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.NotUnderContentRoot -> false
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -27,14 +27,14 @@ import java.util.regex.Pattern;
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("analysis/analysis-api/testData/standalone/binary")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FirStandaloneNormalAnalysisLibraryBinaryModulePsiDeclarationProviderTestGenerated extends AbstractPsiDeclarationProviderTest {
|
||||
public class FirStandaloneNormalAnalysisLibraryBinaryDecompiledModulePsiDeclarationProviderTestGenerated extends AbstractPsiDeclarationProviderTest {
|
||||
@NotNull
|
||||
@Override
|
||||
public AnalysisApiTestConfigurator getConfigurator() {
|
||||
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||
new AnalysisApiTestConfiguratorFactoryData(
|
||||
FrontendKind.Fir,
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibraryBinaryDecompiled,
|
||||
AnalysisSessionMode.Normal,
|
||||
AnalysisApiMode.Standalone
|
||||
)
|
||||
+4
-3
@@ -17,8 +17,8 @@ object AnalysisApiFirStandaloneModeTestConfiguratorFactory : AnalysisApiTestConf
|
||||
AnalysisSessionMode.Dependent -> unsupportedModeError(data)
|
||||
}
|
||||
|
||||
TestModuleKind.LibraryBinary -> when (data.analysisSessionMode) {
|
||||
AnalysisSessionMode.Normal -> StandaloneModeLibraryBinaryTestConfigurator
|
||||
TestModuleKind.LibraryBinaryDecompiled -> when (data.analysisSessionMode) {
|
||||
AnalysisSessionMode.Normal -> StandaloneModeLibraryBinaryDecompiledTestConfigurator
|
||||
AnalysisSessionMode.Dependent -> unsupportedModeError(data)
|
||||
}
|
||||
|
||||
@@ -35,12 +35,13 @@ object AnalysisApiFirStandaloneModeTestConfiguratorFactory : AnalysisApiTestConf
|
||||
data.analysisApiMode != AnalysisApiMode.Standalone -> false
|
||||
else -> when (data.moduleKind) {
|
||||
TestModuleKind.Source,
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibraryBinaryDecompiled,
|
||||
TestModuleKind.CodeFragment -> {
|
||||
true
|
||||
}
|
||||
|
||||
TestModuleKind.ScriptSource,
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibrarySource,
|
||||
TestModuleKind.NotUnderContentRoot -> {
|
||||
false
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.analysis.api.impl.base.test.configurators.AnalysisAp
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.configurators.AnalysisApiLibraryBaseTestServiceRegistrar
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AnalysisApiFirTestServiceRegistrar
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.configureOptionalTestCompilerPlugin
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtLibraryBinaryModuleFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtLibraryBinaryDecompiledModuleFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtModuleFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtTestModuleProjectStructure
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.TestModuleStructureFactory
|
||||
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.test.services.TestModuleStructure
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.configuration.ExternalAnnotationsEnvironmentConfigurator
|
||||
|
||||
object StandaloneModeLibraryBinaryTestConfigurator : StandaloneModeConfiguratorBase() {
|
||||
object StandaloneModeLibraryBinaryDecompiledTestConfigurator : StandaloneModeConfiguratorBase() {
|
||||
override fun configureTest(builder: TestConfigurationBuilder, disposable: Disposable) {
|
||||
super.configureTest(builder, disposable)
|
||||
|
||||
@@ -38,7 +38,7 @@ object StandaloneModeLibraryBinaryTestConfigurator : StandaloneModeConfiguratorB
|
||||
useConfigurators(::ExternalAnnotationsEnvironmentConfigurator)
|
||||
useSourcePreprocessor(::ExternalAnnotationsSourcePreprocessor)
|
||||
|
||||
useAdditionalService<KtModuleFactory> { KtLibraryBinaryModuleFactory }
|
||||
useAdditionalService<KtModuleFactory> { KtLibraryBinaryDecompiledModuleFactory }
|
||||
useAdditionalService<TestModuleCompiler> { DispatchingTestModuleCompiler() }
|
||||
useAdditionalService<TestModuleDecompiler> { TestModuleDecompilerJar() }
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// MAIN_FILE_NAME: I
|
||||
// MODULE_KIND: LibraryBinary
|
||||
// MODULE_KIND: LibraryBinaryDecompiled
|
||||
// FILE: A.kt
|
||||
interface A {
|
||||
var Int.zoo: Unit
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// IGNORE_FE10
|
||||
// MAIN_FILE_NAME: I
|
||||
// MODULE_KIND: LibraryBinary
|
||||
// MODULE_KIND: LibraryBinaryDecompiled
|
||||
// FILE: A.kt
|
||||
interface A {
|
||||
var Int.zoo: Unit
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2010-2024 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.analysis.test.framework.project.structure
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.testModuleDecompiler
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import java.nio.file.Path
|
||||
|
||||
/**
|
||||
* @see TestModuleKind.LibraryBinaryDecompiled
|
||||
*/
|
||||
object KtLibraryBinaryDecompiledModuleFactory : KtLibraryBinaryModuleFactoryBase() {
|
||||
override val testModuleKind: TestModuleKind
|
||||
get() = TestModuleKind.LibraryBinaryDecompiled
|
||||
|
||||
override fun decompileToPsiFiles(binaryRoot: Path, testServices: TestServices, project: Project): List<PsiFile> =
|
||||
testServices.testModuleDecompiler.getAllPsiFilesFromLibrary(binaryRoot, project)
|
||||
}
|
||||
+5
-32
@@ -6,44 +6,17 @@
|
||||
package org.jetbrains.kotlin.analysis.test.framework.project.structure
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.analysis.api.standalone.base.project.structure.StandaloneProjectFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.environmentManager
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.compiledLibraryProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.testModuleDecompiler
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import java.nio.file.Path
|
||||
|
||||
/**
|
||||
* @see TestModuleKind.LibraryBinary
|
||||
*/
|
||||
object KtLibraryBinaryModuleFactory : KtModuleFactory {
|
||||
override fun createModule(
|
||||
testModule: TestModule,
|
||||
contextModule: KtTestModule?,
|
||||
dependencyPaths: Collection<Path>,
|
||||
testServices: TestServices,
|
||||
project: Project,
|
||||
): KtTestModule {
|
||||
val library = testServices.compiledLibraryProvider.compileToLibrary(testModule, dependencyPaths).artifact
|
||||
val decompiledFiles = testServices.testModuleDecompiler.getAllPsiFilesFromLibrary(library, project)
|
||||
object KtLibraryBinaryModuleFactory : KtLibraryBinaryModuleFactoryBase() {
|
||||
override val testModuleKind: TestModuleKind
|
||||
get() = TestModuleKind.LibraryBinary
|
||||
|
||||
return KtTestModule(
|
||||
TestModuleKind.LibraryBinary,
|
||||
testModule,
|
||||
KtLibraryModuleImpl(
|
||||
testModule.name,
|
||||
testModule.targetPlatform,
|
||||
StandaloneProjectFactory.createSearchScopeByLibraryRoots(
|
||||
listOf(library),
|
||||
testServices.environmentManager.getProjectEnvironment(),
|
||||
),
|
||||
project,
|
||||
binaryRoots = listOf(library),
|
||||
librarySources = null,
|
||||
),
|
||||
decompiledFiles,
|
||||
)
|
||||
}
|
||||
override fun decompileToPsiFiles(binaryRoot: Path, testServices: TestServices, project: Project): List<PsiFile> = emptyList()
|
||||
}
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2010-2024 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.analysis.test.framework.project.structure
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.analysis.api.standalone.base.project.structure.StandaloneProjectFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.environmentManager
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.compiledLibraryProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import java.nio.file.Path
|
||||
|
||||
abstract class KtLibraryBinaryModuleFactoryBase : KtModuleFactory {
|
||||
protected abstract val testModuleKind: TestModuleKind
|
||||
|
||||
protected abstract fun decompileToPsiFiles(binaryRoot: Path, testServices: TestServices, project: Project): List<PsiFile>
|
||||
|
||||
override fun createModule(
|
||||
testModule: TestModule,
|
||||
contextModule: KtTestModule?,
|
||||
testServices: TestServices,
|
||||
project: Project,
|
||||
dependencyPaths: Collection<Path>,
|
||||
): KtTestModule {
|
||||
val binaryRoot = testServices.compiledLibraryProvider.compileToLibrary(testModule).artifact
|
||||
val decompiledFiles = decompileToPsiFiles(binaryRoot, testServices, project)
|
||||
|
||||
return KtTestModule(
|
||||
testModuleKind,
|
||||
testModule,
|
||||
KtLibraryModuleImpl(
|
||||
testModule.name,
|
||||
testModule.targetPlatform,
|
||||
StandaloneProjectFactory.createSearchScopeByLibraryRoots(
|
||||
listOf(binaryRoot),
|
||||
testServices.environmentManager.getProjectEnvironment(),
|
||||
),
|
||||
project,
|
||||
binaryRoots = listOf(binaryRoot),
|
||||
librarySources = null,
|
||||
),
|
||||
decompiledFiles,
|
||||
)
|
||||
}
|
||||
}
|
||||
+1
@@ -49,6 +49,7 @@ private val TestServices.ktModuleFactory: KtModuleFactory by TestServices.testSe
|
||||
fun TestServices.getKtModuleFactoryForTestModule(testModule: TestModule): KtModuleFactory = when (testModule.explicitTestModuleKind) {
|
||||
TestModuleKind.Source -> KtSourceModuleFactory
|
||||
TestModuleKind.LibraryBinary -> KtLibraryBinaryModuleFactory
|
||||
TestModuleKind.LibraryBinaryDecompiled -> KtLibraryBinaryDecompiledModuleFactory
|
||||
TestModuleKind.LibrarySource -> KtLibrarySourceModuleFactory
|
||||
TestModuleKind.ScriptSource -> KtScriptModuleFactory
|
||||
TestModuleKind.CodeFragment -> KtCodeFragmentModuleFactory
|
||||
|
||||
+2
-1
@@ -54,7 +54,8 @@ object DependencyKindModuleStructureTransformer : ModuleStructureTransformer() {
|
||||
DependencyKind.Source
|
||||
}
|
||||
|
||||
TestModuleKind.LibraryBinary -> {
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibraryBinaryDecompiled -> {
|
||||
DependencyKind.Binary
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -29,6 +29,18 @@ enum class TestModuleKind(val suffix: String) {
|
||||
*/
|
||||
LibraryBinary("LibraryBinary"),
|
||||
|
||||
/**
|
||||
* A binary library with PSI files decompiled from the library's class files. Instead of building and indexing stubs (if applicable),
|
||||
* the test's declaration provider will instead index the decompiled PSI files directly.
|
||||
*
|
||||
* [LibraryBinaryDecompiled] should be specified when tests access the library's files as test files, usually as a main file in a main
|
||||
* module. See [AbstractAnalysisApiBasedTest][org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest] for an
|
||||
* overview of "main module" and "main file".
|
||||
*
|
||||
* @see org.jetbrains.kotlin.analysis.test.framework.project.structure.KtLibraryBinaryDecompiledModuleFactory
|
||||
*/
|
||||
LibraryBinaryDecompiled("LibraryBinaryDecompiled"),
|
||||
|
||||
/**
|
||||
* @see org.jetbrains.kotlin.analysis.test.framework.project.structure.KtLibrarySourceModuleFactory
|
||||
*/
|
||||
|
||||
-60
@@ -3,16 +3,6 @@ TARGET: public open [<synthetic> STATUS] var something: R|kotlin/String|
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String|
|
||||
public [<synthetic> ResolvedTo(STATUS)] set([ResolvedTo(STATUS)] s: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun getSomething(): kotlin.String { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -28,16 +18,6 @@ TARGET: public open [<synthetic> EXPECT_ACTUAL_MATCHING] var something: R|kotlin
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String|
|
||||
public [<synthetic> ResolvedTo(EXPECT_ACTUAL_MATCHING)] set([ResolvedTo(EXPECT_ACTUAL_MATCHING)] s: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun getSomething(): kotlin.String { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -54,16 +34,6 @@ TARGET: public open [<synthetic> CONTRACTS] var something: R|kotlin/String|
|
||||
public [<synthetic> ResolvedTo(CONTRACTS)] set([ResolvedTo(CONTRACTS)] s: R|kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun getSomething(): kotlin.String { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -81,16 +51,6 @@ TARGET: public open [<synthetic> IMPLICIT_TYPES_BODY_RESOLVE] var something: R|k
|
||||
public [<synthetic> ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun getSomething(): kotlin.String { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -108,16 +68,6 @@ TARGET: public open [<synthetic> ANNOTATION_ARGUMENTS] var something: R|kotlin/S
|
||||
public [<synthetic> ResolvedTo(ANNOTATION_ARGUMENTS)] set([ResolvedTo(ANNOTATION_ARGUMENTS)] s: R|kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun getSomething(): kotlin.String { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -135,16 +85,6 @@ TARGET: public open [<synthetic> BODY_RESOLVE] var something: R|kotlin/String|
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun getSomething(): kotlin.String { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
|
||||
-60
@@ -3,16 +3,6 @@ TARGET: public open override [<synthetic> STATUS] var something: R|kotlin/String
|
||||
public [<synthetic> ResolvedTo(STATUS)] get(): R|kotlin/String| { LAZY_BLOCK }
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun setSomething([ResolvedTo(RAW_FIR)] s: kotlin.String): kotlin.Unit { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -28,16 +18,6 @@ TARGET: public open override [<synthetic> EXPECT_ACTUAL_MATCHING] var something:
|
||||
public [<synthetic> ResolvedTo(EXPECT_ACTUAL_MATCHING)] get(): R|kotlin/String| { LAZY_BLOCK }
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun setSomething([ResolvedTo(RAW_FIR)] s: kotlin.String): kotlin.Unit { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -55,16 +35,6 @@ TARGET: public open override [<synthetic> CONTRACTS] var something: R|kotlin/Str
|
||||
}
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun setSomething([ResolvedTo(RAW_FIR)] s: kotlin.String): kotlin.Unit { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -84,16 +54,6 @@ TARGET: public open override [<synthetic> IMPLICIT_TYPES_BODY_RESOLVE] var somet
|
||||
}
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun setSomething([ResolvedTo(RAW_FIR)] s: kotlin.String): kotlin.Unit { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -113,16 +73,6 @@ TARGET: public open override [<synthetic> ANNOTATION_ARGUMENTS] var something: R
|
||||
}
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun setSomething([ResolvedTo(RAW_FIR)] s: kotlin.String): kotlin.Unit { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
@@ -142,16 +92,6 @@ TARGET: public open override [<synthetic> BODY_RESOLVE] var something: R|kotlin/
|
||||
}
|
||||
public [<synthetic> ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] s: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
FILE: [ResolvedTo(RAW_FIR)] BaseKotlin.class
|
||||
public open [ResolvedTo(RAW_FIR)] class BaseKotlin : BaseJava {
|
||||
public [ResolvedTo(RAW_FIR)] [ContainingClassKey=BaseKotlin] constructor(): R|BaseKotlin| {
|
||||
LAZY_super<<implicit>>
|
||||
}
|
||||
|
||||
public open [ResolvedTo(RAW_FIR)] fun setSomething([ResolvedTo(RAW_FIR)] s: kotlin.String): kotlin.Unit { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] main.kt
|
||||
public final [ResolvedTo(STATUS)] class Derived : R|BaseKotlin| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=Derived] constructor(): R|Derived| {
|
||||
|
||||
+3
-2
@@ -6,7 +6,7 @@
|
||||
package org.jetbrains.kotlin.analysis.low.level.api.fir
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryDecompiledTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.util.FirDeclarationForCompiledElementSearcher
|
||||
import org.jetbrains.kotlin.analysis.project.structure.ProjectStructureProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest
|
||||
@@ -24,7 +24,8 @@ import org.jetbrains.kotlin.test.services.moduleStructure
|
||||
import org.jetbrains.kotlin.test.services.service
|
||||
|
||||
abstract class AbstractLibraryGetOrBuildFirTest : AbstractAnalysisApiBasedTest() {
|
||||
override val configurator = AnalysisApiFirLibraryBinaryTestConfigurator
|
||||
override val configurator get() = AnalysisApiFirLibraryBinaryDecompiledTestConfigurator
|
||||
|
||||
override fun configureTest(builder: TestConfigurationBuilder) {
|
||||
builder.forTestsMatching("analysis/low-level-api-fir/testData/getOrBuildFirBinary/js/*") {
|
||||
this.defaultsProviderBuilder.targetPlatform = JsPlatforms.defaultJsPlatform
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ class AnalysisApiFirCodeFragmentTestConfigurator(
|
||||
useModuleStructureTransformers(DependencyKindModuleStructureTransformer)
|
||||
}
|
||||
|
||||
AnalysisApiFirLibraryBinaryTestConfigurator.configureLibraryCompilationSupport(builder)
|
||||
AnalysisApiFirLibraryBinaryDecompiledTestConfigurator.configureLibraryCompilationSupport(builder)
|
||||
}
|
||||
|
||||
override val serviceRegistrars: List<AnalysisApiTestServiceRegistrar>
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.analysis.api.impl.base.test.configurators.AnalysisAp
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.configurators.AnalysisApiLibraryBaseTestServiceRegistrar
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AnalysisApiFirTestServiceRegistrar
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.configureOptionalTestCompilerPlugin
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtLibraryBinaryModuleFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtLibraryBinaryDecompiledModuleFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtModuleFactory
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtTestModuleProjectStructure
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.TestModuleStructureFactory
|
||||
@@ -29,13 +29,13 @@ import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.services.configuration.JsEnvironmentConfigurator
|
||||
|
||||
object AnalysisApiFirLibraryBinaryTestConfigurator : AnalysisApiTestConfigurator() {
|
||||
object AnalysisApiFirLibraryBinaryDecompiledTestConfigurator : AnalysisApiTestConfigurator() {
|
||||
override val analyseInDependentSession: Boolean get() = false
|
||||
override val frontendKind: FrontendKind get() = FrontendKind.Fir
|
||||
|
||||
override fun configureTest(builder: TestConfigurationBuilder, disposable: Disposable) {
|
||||
builder.apply {
|
||||
useAdditionalService<KtModuleFactory> { KtLibraryBinaryModuleFactory }
|
||||
useAdditionalService<KtModuleFactory> { KtLibraryBinaryDecompiledModuleFactory }
|
||||
useAdditionalService { AnalysisApiIndexingConfiguration(AnalysisApiBinaryLibraryIndexingMode.INDEX_STUBS) }
|
||||
configureLibraryCompilationSupport(this)
|
||||
configureOptionalTestCompilerPlugin()
|
||||
+1
-1
@@ -27,7 +27,7 @@ open class AnalysisApiFirSourceTestConfigurator(
|
||||
useModuleStructureTransformers(DependencyKindModuleStructureTransformer)
|
||||
}
|
||||
|
||||
AnalysisApiFirLibraryBinaryTestConfigurator.configureLibraryCompilationSupport(builder)
|
||||
AnalysisApiFirLibraryBinaryDecompiledTestConfigurator.configureLibraryCompilationSupport(builder)
|
||||
}
|
||||
|
||||
override val serviceRegistrars: List<AnalysisApiTestServiceRegistrar>
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.light.classes.symbol.decompiled.test.configurators
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryDecompiledTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtTestModuleProjectStructure
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestServiceRegistrar
|
||||
@@ -21,11 +21,11 @@ object AnalysisApiSymbolLightClassesDecompiledTestConfigurator : AnalysisApiTest
|
||||
override val frontendKind: FrontendKind get() = FrontendKind.Fir
|
||||
|
||||
override fun configureTest(builder: TestConfigurationBuilder, disposable: Disposable) {
|
||||
AnalysisApiFirLibraryBinaryTestConfigurator.configureTest(builder, disposable)
|
||||
AnalysisApiFirLibraryBinaryDecompiledTestConfigurator.configureTest(builder, disposable)
|
||||
}
|
||||
|
||||
override val serviceRegistrars: List<AnalysisApiTestServiceRegistrar>
|
||||
get() = AnalysisApiFirLibraryBinaryTestConfigurator.serviceRegistrars +
|
||||
get() = AnalysisApiFirLibraryBinaryDecompiledTestConfigurator.serviceRegistrars +
|
||||
AnalysisApiSymbolLightClassesDecompiledTestServiceRegistrar
|
||||
|
||||
override fun createModules(
|
||||
@@ -33,6 +33,6 @@ object AnalysisApiSymbolLightClassesDecompiledTestConfigurator : AnalysisApiTest
|
||||
testServices: TestServices,
|
||||
project: Project
|
||||
): KtTestModuleProjectStructure {
|
||||
return AnalysisApiFirLibraryBinaryTestConfigurator.createModules(moduleStructure, testServices, project)
|
||||
return AnalysisApiFirLibraryBinaryDecompiledTestConfigurator.createModules(moduleStructure, testServices, project)
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -131,7 +131,7 @@ internal fun AnalysisApiTestGroup.generateAnalysisApiTests() {
|
||||
generateResolveExtensionsTests()
|
||||
}
|
||||
group(
|
||||
filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.ScriptSource, TestModuleKind.LibraryBinary) and
|
||||
filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.ScriptSource, TestModuleKind.LibraryBinaryDecompiled) and
|
||||
analysisApiModeIs(AnalysisApiMode.Standalone)
|
||||
) {
|
||||
generateAnalysisApiStandaloneTests()
|
||||
@@ -254,9 +254,10 @@ private fun AnalysisApiTestGroup.generateAnalysisApiStandaloneTests() {
|
||||
) {
|
||||
model(it, "source")
|
||||
}
|
||||
|
||||
test(
|
||||
AbstractPsiDeclarationProviderTest::class,
|
||||
filter = testModuleKindIs(TestModuleKind.LibraryBinary)
|
||||
filter = testModuleKindIs(TestModuleKind.LibraryBinaryDecompiled)
|
||||
) {
|
||||
model(it, "binary")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user