[MPP][Test] Implement Diagnostics with mpp composite analysis tests
Using the 'MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE' test directive will add support for testing "cli metadata compilation" and "ide analysis" _like_ configurations. In this configuration, dependsOn modules will not be analyzed together with dependents in the same ModuleDescriptor, but will be passed as separate 'expectedBy' dependency descriptor. Used to cover ^KT-50120 inside kotlin.git
This commit is contained in:
committed by
Space
parent
7771e5914d
commit
3598ba1d45
@@ -5,10 +5,12 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve
|
||||
|
||||
import org.jetbrains.kotlin.container.DefaultImplementation
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
|
||||
@DefaultImplementation(ModuleStructureOracle.SingleModule::class)
|
||||
interface ModuleStructureOracle {
|
||||
// May be faster than `findAllImplementingModules(module).isNotEmpty()`
|
||||
// May be faster than `findAllReversedDependsOnPaths(module).isNotEmpty()`
|
||||
fun hasImplementingModules(module: ModuleDescriptor): Boolean
|
||||
|
||||
fun findAllReversedDependsOnPaths(module: ModuleDescriptor): List<ModulePath>
|
||||
@@ -31,4 +33,4 @@ interface ModuleStructureOracle {
|
||||
|
||||
class ModulePath(val nodes: List<ModuleDescriptor>) {
|
||||
constructor(vararg nodes: ModuleDescriptor) : this(nodes.toList())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ abstract class TargetEnvironment(private val name: String) {
|
||||
container.useInstance(BodyResolveCache.ThrowException)
|
||||
container.useImpl<CompilerLocalDescriptorResolver>()
|
||||
container.useImpl<BasicAbsentDescriptorHandler>()
|
||||
container.useInstance(ModuleStructureOracle.SingleModule)
|
||||
container.useImpl<MainFunctionDetector.Factory.Ordinary>()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user