[K/N][Tests] Migrate second ObjC test with framework
^KT-61259
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
// TARGET_BACKEND: NATIVE
|
||||||
|
// DISABLE_NATIVE: isAppleTarget=false
|
||||||
|
|
||||||
|
// FREE_CINTEROP_ARGS: -compiler-option -fmodule-map-file=$generatedSourcesDir/cinterop/module_library.modulemap
|
||||||
|
// FREE_CINTEROP_ARGS: -compiler-option -I$generatedSourcesDir/cinterop
|
||||||
|
// MODULE: cinterop
|
||||||
|
// FILE: module_library.def
|
||||||
|
language = Objective-C
|
||||||
|
modules = module_library
|
||||||
|
|
||||||
|
// FILE: module_library.modulemap
|
||||||
|
module module_library {
|
||||||
|
umbrella header "module_library_umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: module_library_umbrella.h
|
||||||
|
#import <foo.h>
|
||||||
|
|
||||||
|
// FILE: foo.h
|
||||||
|
#define ANSWER 42
|
||||||
|
|
||||||
|
// MODULE: main(cinterop)
|
||||||
|
// FILE: main.kt
|
||||||
|
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||||
|
import module_library.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val answer = ANSWER
|
||||||
|
if (answer != 42)
|
||||||
|
return "FAIL: $answer"
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
@@ -1160,12 +1160,6 @@ if (PlatformInfo.isAppleTarget(project)) {
|
|||||||
it.extraOpts '-Xforeign-exception-mode', "objc-wrap"
|
it.extraOpts '-Xforeign-exception-mode', "objc-wrap"
|
||||||
}
|
}
|
||||||
|
|
||||||
createInterop("objcKt34467") {
|
|
||||||
it.defFile 'interop/objc/kt34467/module_library.def'
|
|
||||||
def moduleMap = file("interop/objc/kt34467/module_library.modulemap").absolutePath
|
|
||||||
def includePath = file("interop/objc/kt34467").absolutePath
|
|
||||||
it.compilerOpts "-fmodule-map-file=$moduleMap", "-I$includePath"
|
|
||||||
}
|
|
||||||
createInterop("objcGh3343") {
|
createInterop("objcGh3343") {
|
||||||
it.defFile 'framework/gh3343/objclib.def'
|
it.defFile 'framework/gh3343/objclib.def'
|
||||||
it.headers "$projectDir/framework/gh3343/objclib.h"
|
it.headers "$projectDir/framework/gh3343/objclib.h"
|
||||||
@@ -1631,12 +1625,6 @@ if (PlatformInfo.isAppleTarget(project)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interopTest("interop_objc_kt34467") {
|
|
||||||
source = "interop/objc/kt34467/foo.kt"
|
|
||||||
interop = 'objcKt34467'
|
|
||||||
useGoldenData = true
|
|
||||||
}
|
|
||||||
|
|
||||||
interopTest("interop_objc_illegal_sharing_with_weak") {
|
interopTest("interop_objc_illegal_sharing_with_weak") {
|
||||||
source = "interop/objc/illegal_sharing_with_weak/main.kt"
|
source = "interop/objc/illegal_sharing_with_weak/main.kt"
|
||||||
interop = 'objc_illegal_sharing_with_weak'
|
interop = 'objc_illegal_sharing_with_weak'
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#define ANSWER 42
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import module_library.*
|
|
||||||
|
|
||||||
fun main() {
|
|
||||||
println("OK")
|
|
||||||
println(ANSWER)
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
OK
|
|
||||||
42
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
language = Objective-C
|
|
||||||
modules = module_library
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
module module_library {
|
|
||||||
umbrella header "module_library_umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#import <foo.h>
|
|
||||||
+6
@@ -5068,6 +5068,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt34467.kt")
|
||||||
|
public void testKt34467() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/cinterop/objc/kt34467.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt53151.kt")
|
@TestMetadata("kt53151.kt")
|
||||||
public void testKt53151() throws Exception {
|
public void testKt53151() throws Exception {
|
||||||
|
|||||||
+6
@@ -5184,6 +5184,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt34467.kt")
|
||||||
|
public void testKt34467() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/cinterop/objc/kt34467.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt53151.kt")
|
@TestMetadata("kt53151.kt")
|
||||||
public void testKt53151() throws Exception {
|
public void testKt53151() throws Exception {
|
||||||
|
|||||||
+6
@@ -4952,6 +4952,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt34467.kt")
|
||||||
|
public void testKt34467() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/cinterop/objc/kt34467.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt53151.kt")
|
@TestMetadata("kt53151.kt")
|
||||||
public void testKt53151() throws Exception {
|
public void testKt53151() throws Exception {
|
||||||
|
|||||||
+6
@@ -5069,6 +5069,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/objc"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt34467.kt")
|
||||||
|
public void testKt34467() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/cinterop/objc/kt34467.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt53151.kt")
|
@TestMetadata("kt53151.kt")
|
||||||
public void testKt53151() throws Exception {
|
public void testKt53151() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user