[FIR Test] Migrate AbstractFirLoadCompiledKotlin to new test infrastructure

Also introduce two different modes for those tests:
- load metadata compiled with K1
- load metadata compiled with K2
This commit is contained in:
Dmitriy Novozhilov
2023-04-17 11:54:59 +03:00
committed by Space Team
parent 63829876b7
commit 6287968511
253 changed files with 9801 additions and 3015 deletions
@@ -218,6 +218,18 @@ object CodegenTestDirectives : SimpleDirectivesContainer() {
Ignore FIR2IR exceptions if FIR reported some diagnostics with ERROR severity
""".trimIndent()
)
val IGNORE_FIR_METADATA_LOADING_K1 by directive(
description = """
Ignore exceptions in AbstractFirLoadK1CompiledKotlin tests
""".trimIndent()
)
val IGNORE_FIR_METADATA_LOADING_K2 by directive(
description = """
Ignore exceptions in AbstractFirLoadK2CompiledKotlin tests
""".trimIndent()
)
}
fun extractIgnoredDirectivesForTargetBackend(
@@ -69,15 +69,8 @@ abstract class AbstractKotlinCompilerTest {
}
@BeforeEach
@OptIn(ExperimentalStdlibApi::class)
fun initTestInfo(testInfo: TestInfo) {
initTestInfo(
KotlinTestInfo(
className = testInfo.testClass.getOrNull()?.name ?: "_undefined_",
methodName = testInfo.testMethod.getOrNull()?.name ?: "_testUndefined_",
tags = testInfo.tags
)
)
initTestInfo(testInfo.toKotlinTestInfo())
}
fun initTestInfo(testInfo: KotlinTestInfo) {
@@ -109,3 +102,11 @@ abstract class AbstractKotlinCompilerTest {
}.runTest(filePath)
}
}
fun TestInfo.toKotlinTestInfo(): KotlinTestInfo {
return KotlinTestInfo(
className = this.testClass.getOrNull()?.name ?: "_undefined_",
methodName = this.testMethod.getOrNull()?.name ?: "_testUndefined_",
tags = this.tags
)
}