Alexander Shabalin
2021-05-27 17:18:55 +00:00
committed by Space
parent 0b1884c994
commit af1f57007a
23 changed files with 190 additions and 75 deletions
@@ -4316,7 +4316,7 @@ if (PlatformInfo.isAppleTarget(project)) {
}
interopTestMultifile("interop_objc_tests") {
enabled = !isExperimentalMM // Experimental MM does not support Obj-C weaks and thread state switching for ObjC interop yet.
enabled = !isExperimentalMM // Experimental MM does not support thread state switching for ObjC interop yet.
source = "interop/objc/tests/"
interop = 'objcTests'
flags = ['-tr', '-e', 'main']
@@ -4787,7 +4787,7 @@ Task frameworkTest(String name, Closure<FrameworkTest> configurator) {
if (isAppleTarget(project)) {
frameworkTest('testObjCExport') {
enabled = !isExperimentalMM // Experimental MM does not support Obj-C weaks and thread state switching for ObjC interop yet.
enabled = !isExperimentalMM // Experimental MM does not support thread state switching for ObjC interop yet.
final String frameworkName = 'Kt'
final String dir = "$testOutputFramework/testObjCExport"
final File lazyHeader = file("$dir/$target-lazy.h")
@@ -4836,7 +4836,7 @@ if (isAppleTarget(project)) {
}
frameworkTest('testObjCExportNoGenerics') {
enabled = !isExperimentalMM // Experimental MM does not support Obj-C weaks and thread state switching for ObjC interop yet.
enabled = !isExperimentalMM // Experimental MM does not support thread state switching for ObjC interop yet.
final String frameworkName = 'KtNoGenerics'
final String frameworkArtifactName = 'Kt'
final String dir = "$testOutputFramework/testObjCExportNoGenerics"
@@ -4889,7 +4889,7 @@ if (isAppleTarget(project)) {
}
frameworkTest('testObjCExportStatic') {
enabled = !isExperimentalMM // Experimental MM does not support Obj-C weaks and thread state switching for ObjC interop yet.
enabled = !isExperimentalMM // Experimental MM does not support thread state switching for ObjC interop yet.
final String frameworkName = 'KtStatic'
final String frameworkArtifactName = 'Kt'
final String libraryName = frameworkName + "Library"
@@ -2312,6 +2312,7 @@ __attribute__((swift_name("ValuesKt")))
@property (class) id _Nullable warningVar __attribute__((swift_name("warningVar"))) __attribute__((deprecated("warning")));
@property (class) int32_t gh3525BaseInitCount __attribute__((swift_name("gh3525BaseInitCount")));
@property (class) int32_t gh3525InitCount __attribute__((swift_name("gh3525InitCount")));
@property (class, readonly) BOOL isExperimentalMM __attribute__((swift_name("isExperimentalMM")));
@end;
__attribute__((swift_name("InvariantSuper")))
@@ -2285,6 +2285,7 @@ __attribute__((swift_name("ValuesKt")))
@property (class) id _Nullable warningVar __attribute__((swift_name("warningVar"))) __attribute__((deprecated("warning")));
@property (class) int32_t gh3525BaseInitCount __attribute__((swift_name("gh3525BaseInitCount")));
@property (class) int32_t gh3525InitCount __attribute__((swift_name("gh3525InitCount")));
@property (class, readonly) BOOL isExperimentalMM __attribute__((swift_name("isExperimentalMM")));
@end;
__attribute__((swift_name("InvariantSuper")))
@@ -1020,4 +1020,7 @@ interface Bar_FakeOverrideInInterface : Foo_FakeOverrideInInterface<String>
fun callFoo_FakeOverrideInInterface(obj: Bar_FakeOverrideInInterface) {
obj.foo(null)
}
}
val isExperimentalMM: Boolean
get() = kotlin.native.Platform.memoryModel == kotlin.native.MemoryModel.EXPERIMENTAL
@@ -596,10 +596,17 @@ func testShared() throws {
try assertFalse(ValuesKt.isFrozen(obj: obj), "isFrozen(\(obj))")
}
try assertFrozen(NSObject())
try assertFrozen(TestSharedIImpl())
try assertFrozen(ValuesKt.kotlinLambda(block: { return $0 }) as AnyObject)
try assertNotFrozen(FinalClassExtOpen())
if ValuesKt.isExperimentalMM {
try assertNotFrozen(NSObject())
try assertNotFrozen(TestSharedIImpl())
try assertNotFrozen(ValuesKt.kotlinLambda(block: { return $0 }) as AnyObject)
try assertNotFrozen(FinalClassExtOpen())
} else {
try assertFrozen(NSObject())
try assertFrozen(TestSharedIImpl())
try assertFrozen(ValuesKt.kotlinLambda(block: { return $0 }) as AnyObject)
try assertNotFrozen(FinalClassExtOpen())
}
}
class PureSwiftClass {
@@ -1411,4 +1418,4 @@ class ValuesTests : SimpleTestProvider {
// Stress test, must remain the last one:
test("TestGH2931", testGH2931)
}
}
}