Cleanup interop tests for Apple targets: unify it with appropriate createInterop { }
This commit is contained in:
committed by
Pavel Punegov
parent
943fcab720
commit
f68a0bfd69
@@ -3560,87 +3560,83 @@ standaloneTest("interop_opengl_teapot") {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interopTest("interop_objc_smoke") {
|
if (PlatformInfo.isAppleTarget(project)) {
|
||||||
disabled = !isAppleTarget(project)
|
interopTest("interop_objc_smoke") {
|
||||||
goldValue = "84\nFoo\nDeallocated\n" +
|
goldValue = "84\nFoo\nDeallocated\n" +
|
||||||
"Hello, World!\nKotlin says: Hello, everybody!\nHello from Kotlin\n2, 1\n" +
|
"Hello, World!\nKotlin says: Hello, everybody!\nHello from Kotlin\n2, 1\n" +
|
||||||
"true\ntrue\n" +
|
"true\ntrue\n" +
|
||||||
"Global string\nAnother global string\nnull\nglobal object\n" +
|
"Global string\nAnother global string\nnull\nglobal object\n" +
|
||||||
"5\n" +
|
"5\n" +
|
||||||
"String macro\n" +
|
"String macro\n" +
|
||||||
"CFString macro\n" +
|
"CFString macro\n" +
|
||||||
"Deallocated\nDeallocated\n" +
|
"Deallocated\nDeallocated\n" +
|
||||||
"Class TestExportObjCClass34 has multiple implementations. Which one will be used is undefined.\n"
|
"Class TestExportObjCClass34 has multiple implementations. Which one will be used is undefined.\n"
|
||||||
|
|
||||||
source = "interop/objc/smoke.kt"
|
source = "interop/objc/smoke.kt"
|
||||||
interop = 'objcSmoke'
|
interop = 'objcSmoke'
|
||||||
|
|
||||||
if (twoStageEnabled) {
|
if (twoStageEnabled) {
|
||||||
// Without this flag the test fails in the two-stage mode due to KT-33160.
|
// Without this flag the test fails in the two-stage mode due to KT-33160.
|
||||||
// TODO: Remove this flag when the bug is fixed.
|
// TODO: Remove this flag when the bug is fixed.
|
||||||
flags += "-nodefaultlibs"
|
flags += "-nodefaultlibs"
|
||||||
}
|
|
||||||
|
|
||||||
doBeforeBuild {
|
|
||||||
execKonanClang(project.target) {
|
|
||||||
args "$projectDir/interop/objc/smoke.m"
|
|
||||||
args "-lobjc", '-fobjc-arc'
|
|
||||||
args '-fPIC', '-shared', '-o', "$buildDir/libobjcsmoke.dylib"
|
|
||||||
}
|
|
||||||
if (project.target instanceof KonanTarget.IOS_X64) {
|
|
||||||
UtilsKt.codesign(project, "$buildDir/libobjcsmoke.dylib")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
copy {
|
doBeforeBuild {
|
||||||
from("interop/objc/Localizable.stringsdict")
|
execKonanClang(project.target) {
|
||||||
into("$testOutputLocal/$name/$target/en.lproj/")
|
args "$projectDir/interop/objc/smoke.m"
|
||||||
|
args "-lobjc", '-fobjc-arc'
|
||||||
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcsmoke.dylib"
|
||||||
|
}
|
||||||
|
if (project.target instanceof KonanTarget.IOS_X64) {
|
||||||
|
UtilsKt.codesign(project, "$buildDir/libobjcsmoke.dylib")
|
||||||
|
}
|
||||||
|
|
||||||
|
copy {
|
||||||
|
from("interop/objc/Localizable.stringsdict")
|
||||||
|
into("$testOutputLocal/$name/$target/en.lproj/")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
interopTest("interop_objc_global_initializer") {
|
interopTest("interop_objc_global_initializer") {
|
||||||
disabled = !isAppleTarget(project)
|
goldValue = "OK\n"
|
||||||
goldValue = "OK\n"
|
source = "interop/objc_with_initializer/objc_test.kt"
|
||||||
|
interop = 'objcMisc'
|
||||||
|
flags = ['-g']
|
||||||
|
|
||||||
source = "interop/objc_with_initializer/objc_test.kt"
|
doBeforeBuild {
|
||||||
interop = 'objcMisc'
|
execKonanClang(project.target) {
|
||||||
flags = ['-g']
|
args "$projectDir/interop/objc_with_initializer/objc_misc.m"
|
||||||
|
args "-lobjc", '-fobjc-arc'
|
||||||
doBeforeBuild {
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcmisc.dylib"
|
||||||
execKonanClang(project.target) {
|
}
|
||||||
args "$projectDir/interop/objc_with_initializer/objc_misc.m"
|
if (project.target instanceof KonanTarget.IOS_X64) {
|
||||||
args "-lobjc", '-fobjc-arc'
|
UtilsKt.codesign(project, "$buildDir/libobjcmisc.dylib")
|
||||||
args '-fPIC', '-shared', '-o', "$buildDir/libobjcmisc.dylib"
|
}
|
||||||
}
|
|
||||||
if (project.target instanceof KonanTarget.IOS_X64) {
|
|
||||||
UtilsKt.codesign(project, "$buildDir/libobjcmisc.dylib")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
interopTest("interop_objc_msg_send") {
|
interopTest("interop_objc_msg_send") {
|
||||||
disabled = !isAppleTarget(project)
|
source = "interop/objc/msg_send/main.kt"
|
||||||
|
interop = 'objcMessaging'
|
||||||
|
|
||||||
source = "interop/objc/msg_send/main.kt"
|
doBeforeBuild {
|
||||||
interop = 'objcMessaging'
|
execKonanClang(project.target) {
|
||||||
|
args "$projectDir/interop/objc/msg_send/messaging.m"
|
||||||
doBeforeBuild {
|
args "-lobjc", '-fobjc-arc'
|
||||||
execKonanClang(project.target) {
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcmessaging.dylib"
|
||||||
args "$projectDir/interop/objc/msg_send/messaging.m"
|
}
|
||||||
args "-lobjc", '-fobjc-arc'
|
if (project.target instanceof KonanTarget.IOS_X64) {
|
||||||
args '-fPIC', '-shared', '-o', "$buildDir/libobjcmessaging.dylib"
|
UtilsKt.codesign(project, "$buildDir/libobjcmessaging.dylib")
|
||||||
}
|
}
|
||||||
if (project.target instanceof KonanTarget.IOS_X64) {
|
|
||||||
UtilsKt.codesign(project, "$buildDir/libobjcmessaging.dylib")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
interopTest("interop_objc_kt34467") {
|
interopTest("interop_objc_kt34467") {
|
||||||
disabled = !isAppleTarget(project)
|
source = "interop/objc/kt34467/foo.kt"
|
||||||
source = "interop/objc/kt34467/foo.kt"
|
interop = 'objcKt34467'
|
||||||
interop = 'objcKt34467'
|
goldValue = "OK\n42\n"
|
||||||
goldValue = "OK\n42\n"
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
standaloneTest("jsinterop_math") {
|
standaloneTest("jsinterop_math") {
|
||||||
|
|||||||
Reference in New Issue
Block a user