[FIR] add tests on external annotations

Tests are excluded in COMPILED_JAVA mode because in this
mode external annotations are not present at all

^KT-62310
This commit is contained in:
Dmitrii Gridin
2023-10-05 11:46:50 +02:00
committed by Space Team
parent e452113a7a
commit 2cac922cd0
45 changed files with 1158 additions and 17 deletions
@@ -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.
*/
@@ -183,7 +183,7 @@ object TestModuleStructureFactory {
fun createSourcePsiFiles(
testModule: TestModule,
testServices: TestServices,
project: Project
project: Project,
): List<PsiFile> {
return testModule.files.map { testFile ->
when {
@@ -192,7 +192,7 @@ object TestModuleStructureFactory {
KtTestUtil.createFile(testFile.name, fileText, project)
}
testFile.isJavaFile -> {
testFile.isJavaFile || testFile.isExternalAnnotation -> {
val filePath = testServices.sourceFileProvider.getRealFileForSourceFile(testFile)
val virtualFile =
testServices.environmentManager.getApplicationEnvironment().localFileSystem.findFileByIoFile(filePath)
@@ -205,7 +205,5 @@ object TestModuleStructureFactory {
}
}
}
}