[K/N][Tests] Add test for KT-65659

^KT-65659
This commit is contained in:
Vladimir Sukharev
2024-02-13 23:26:54 +01:00
committed by Space Team
parent 090407b7e3
commit 243d6aed50
2 changed files with 27 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
typealias MyThrows = kotlin.Throws
class Foo {
@kotlin.Throws(Exception::class)
fun noalias() {}
@MyThrows(Exception::class)
fun aliased() {}
}
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.native.executors.runProcess
import org.jetbrains.kotlin.test.KtAssert.fail
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
import java.io.File
@@ -40,6 +41,23 @@ abstract class FrameworkTestBase : AbstractNativeSimpleTest() {
private val extras = TestCase.NoTestRunnerExtras("There's no entrypoint in Swift program")
private val testCompilationFactory = TestCompilationFactory()
@Disabled("KT-65659 is not yet fixed for K2")
@Test
fun testKT65659() {
Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily)
val testDataFile = testSuiteDir.resolve("kt65659.kt")
val testCase = generateObjCFrameworkTestCase(
TestKind.STANDALONE_NO_TR,
extras,
"kt65659",
listOf(testDataFile),
TestCompilerArgs(listOf("-Xbinary=bundleId=kt65659")),
)
val objCFrameworkCompilation = testCompilationFactory.testCaseToObjCFrameworkCompilation(testCase, testRunSettings)
val compilationResult = objCFrameworkCompilation.result.assertSuccess()
assertTrue(compilationResult.resultingArtifact.mainHeader.readText().contains("aliasedAndReturnError"))
}
@Test
fun testSignextZeroext() {
Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily)