KT-63096 [LL] Add test for using annotation from other module for compiler plugin
This commit is contained in:
+16
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user