KT-63096 [LL] Add test for using annotation from other module for compiler plugin

This commit is contained in:
Roman Golyshev
2023-11-06 18:38:21 +01:00
committed by teamcity
parent 2f50267d3f
commit 500dd20277
8 changed files with 93 additions and 2 deletions
@@ -57,4 +57,20 @@ public class FirStandaloneNormalAnalysisSourceModuleMultiModuleResolveCallTestGe
public void testUnitTypeFromOtherModule() throws Exception {
runTest("analysis/analysis-api/testData/components/multiModuleCallResolver/resolveCall/unitTypeFromOtherModule.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/multiModuleCallResolver/resolveCall/withTestCompilerPluginEnabled")
@TestDataPath("$PROJECT_ROOT")
public class WithTestCompilerPluginEnabled {
@Test
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/multiModuleCallResolver/resolveCall/withTestCompilerPluginEnabled"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("annotationFromOtherModule.kt")
public void testAnnotationFromOtherModule() throws Exception {
runTest("analysis/analysis-api/testData/components/multiModuleCallResolver/resolveCall/withTestCompilerPluginEnabled/annotationFromOtherModule.kt");
}
}
}
@@ -9,6 +9,7 @@ import com.intellij.openapi.Disposable
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.analysis.api.standalone.base.project.structure.KtModuleProjectStructure
import org.jetbrains.kotlin.analysis.low.level.api.fir.compiler.based.SealedClassesInheritorsCaclulatorPreAnalysisHandler
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.configureOptionalTestCompilerPlugin
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirSourceTestConfigurator
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtModuleFactory
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtSourceModuleFactory
@@ -33,6 +34,7 @@ object StandaloneModeConfigurator : AnalysisApiTestConfigurator() {
useAdditionalService<KtModuleFactory> { KtSourceModuleFactory() }
useDirectives(SealedClassesInheritorsCaclulatorPreAnalysisHandler.Directives)
usePreAnalysisHandlers(::SealedClassesInheritorsCaclulatorPreAnalysisHandler)
configureOptionalTestCompilerPlugin()
useConfigurators(::ExternalAnnotationsEnvironmentConfigurator)
useSourcePreprocessor(::ExternalAnnotationsSourcePreprocessor)
}