[K/N][Tests] Migrate kt56048 test

^KT-61259
This commit is contained in:
Vladimir Sukharev
2024-01-17 21:53:37 +01:00
parent cc13888dd0
commit 447c0fb618
6 changed files with 33 additions and 24 deletions
@@ -1180,9 +1180,6 @@ if (PlatformInfo.isAppleTarget(project)) {
it.defFile 'interop/objc/kt48816/objclib.def'
it.headers "$projectDir/interop/objc/kt48816/objclib.h"
}
createInterop("objc_kt50648") {
it.defFile 'interop/objc/kt50648/objclib.def'
}
createInterop("objc_kt55938") {
it.defFile 'interop/objc/kt55938/objclib.def'
it.headers "$projectDir/interop/objc/kt55938/objclib.h"
@@ -1668,16 +1665,6 @@ if (PlatformInfo.isAppleTarget(project)) {
flags = ["-Xlazy-ir-for-caches=enable"]
}
interopTest("interop_objc_kt50648") {
source = 'interop/objc/kt50648/main.kt'
interop = "objc_kt50648"
expectedExitStatusChecker = { it != 0 }
outputChecker = {
it.contains("Converting Obj-C blocks with non-reference-typed return value to kotlin.Any is not supported (v)") &&
(it.contains("kfun:#main(){}") || project.globalTestArgs.contains('-opt')) // Stacktrace.
}
}
interopTest("interop_objc_kt55938") {
source = "interop/objc/kt55938/main.kt"
lib = "interop/objc/kt55938/lib.kt"
@@ -1,5 +0,0 @@
import objclib.*
fun main() {
getVoidBlockAsId()
}
@@ -1,6 +0,0 @@
language = Objective-C
---
id getVoidBlockAsId() {
void (^result)(void) = ^{};
return result;
}
+21
View File
@@ -0,0 +1,21 @@
// TARGET_BACKEND: NATIVE
// EXIT_CODE: !0
// OUTPUT_REGEX: .*Converting Obj-C blocks with non-reference-typed return value to kotlin.Any is not supported \(v\).*kfun:#main.*
// MODULE: cinterop
// FILE: objclib.def
language = Objective-C
---
id getVoidBlockAsId() {
void (^result)(void) = ^{};
return result;
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import objclib.*
fun main() {
getVoidBlockAsId()
}
@@ -34,6 +34,12 @@ public class FirNativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("kt56048.kt")
public void testKt56048() throws Exception {
runTest("native/native.tests/testData/standalone/kt56048.kt");
}
@Nested
@TestMetadata("native/native.tests/testData/standalone/console")
@TestDataPath("$PROJECT_ROOT")
@@ -31,6 +31,12 @@ public class NativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("kt56048.kt")
public void testKt56048() throws Exception {
runTest("native/native.tests/testData/standalone/kt56048.kt");
}
@Nested
@TestMetadata("native/native.tests/testData/standalone/console")
@TestDataPath("$PROJECT_ROOT")