[AA] add configurator for scripts
^KT-61431
This commit is contained in:
committed by
Space Team
parent
0a5501b8dd
commit
bef5f89f61
+3
-1
@@ -30,8 +30,10 @@ object AnalysisApiFe10TestConfiguratorFactory : AnalysisApiTestConfiguratorFacto
|
||||
data.analysisApiMode != AnalysisApiMode.Ide -> false
|
||||
else -> when (data.moduleKind) {
|
||||
TestModuleKind.Source -> true
|
||||
TestModuleKind.ScriptSource,
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibrarySource -> false
|
||||
TestModuleKind.LibrarySource,
|
||||
-> false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.analysis.api.fir.test.configurators
|
||||
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirLibraryBinaryTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.library.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
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.*
|
||||
|
||||
@@ -15,6 +16,11 @@ object AnalysisApiFirTestConfiguratorFactory : AnalysisApiTestConfiguratorFactor
|
||||
require(supportMode(data))
|
||||
|
||||
return when (data.moduleKind) {
|
||||
TestModuleKind.ScriptSource -> when (data.analysisSessionMode) {
|
||||
AnalysisSessionMode.Normal -> AnalysisApiFirScriptTestConfigurator(analyseInDependentSession = false)
|
||||
AnalysisSessionMode.Dependent -> AnalysisApiFirScriptTestConfigurator(analyseInDependentSession = true)
|
||||
}
|
||||
|
||||
TestModuleKind.Source -> when (data.analysisSessionMode) {
|
||||
AnalysisSessionMode.Normal -> AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = false)
|
||||
AnalysisSessionMode.Dependent -> AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = true)
|
||||
@@ -37,7 +43,7 @@ object AnalysisApiFirTestConfiguratorFactory : AnalysisApiTestConfiguratorFactor
|
||||
data.frontend != FrontendKind.Fir -> false
|
||||
data.analysisApiMode != AnalysisApiMode.Ide -> false
|
||||
else -> when (data.moduleKind) {
|
||||
TestModuleKind.Source -> true
|
||||
TestModuleKind.Source, TestModuleKind.ScriptSource -> true
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibrarySource ->
|
||||
data.analysisSessionMode == AnalysisSessionMode.Normal
|
||||
|
||||
+5
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 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.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.analysis.api.standalone.fir.test
|
||||
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.*
|
||||
|
||||
public object AnalysisApiFirStandaloneModeTestConfiguratorFactory : AnalysisApiTestConfiguratorFactory() {
|
||||
object AnalysisApiFirStandaloneModeTestConfiguratorFactory : AnalysisApiTestConfiguratorFactory() {
|
||||
override fun createConfigurator(data: AnalysisApiTestConfiguratorFactoryData): AnalysisApiTestConfigurator {
|
||||
requireSupported(data)
|
||||
|
||||
@@ -30,8 +30,10 @@ public object AnalysisApiFirStandaloneModeTestConfiguratorFactory : AnalysisApiT
|
||||
data.analysisApiMode != AnalysisApiMode.Standalone -> false
|
||||
else -> when (data.moduleKind) {
|
||||
TestModuleKind.Source -> true
|
||||
TestModuleKind.ScriptSource,
|
||||
TestModuleKind.LibraryBinary,
|
||||
TestModuleKind.LibrarySource -> false
|
||||
TestModuleKind.LibrarySource,
|
||||
-> false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -47,5 +47,6 @@ enum class FrontendKind(val suffix: String) {
|
||||
enum class TestModuleKind(val suffix: String) {
|
||||
Source("Source"),
|
||||
LibraryBinary("LibraryBinary"),
|
||||
LibrarySource("LibrarySource");
|
||||
LibrarySource("LibrarySource"),
|
||||
ScriptSource("ScriptSource"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user