[K/N][Runtime] Use the objc module in the unit tests
Calling initRuntime requires some machinery from the objc module (e.g. adding the toKotlin method to NSObject). Include this module to the tests to allow full runtime initialization in the tests
This commit is contained in:
@@ -144,7 +144,8 @@ targetList.forEach { targetName ->
|
||||
"${targetName}LegacyMemoryManager",
|
||||
"${targetName}Strict",
|
||||
"${targetName}Release",
|
||||
"${targetName}StdAlloc"
|
||||
"${targetName}StdAlloc",
|
||||
"${targetName}Objc"
|
||||
)
|
||||
) {
|
||||
includeRuntime()
|
||||
@@ -160,7 +161,8 @@ targetList.forEach { targetName ->
|
||||
"${targetName}Strict",
|
||||
"${targetName}Release",
|
||||
"${targetName}Mimalloc",
|
||||
"${targetName}OptAlloc"
|
||||
"${targetName}OptAlloc",
|
||||
"${targetName}Objc"
|
||||
)
|
||||
) {
|
||||
includeRuntime()
|
||||
@@ -177,7 +179,8 @@ targetList.forEach { targetName ->
|
||||
"${targetName}SameThreadMsGc",
|
||||
"${targetName}Release",
|
||||
"${targetName}Mimalloc",
|
||||
"${targetName}OptAlloc"
|
||||
"${targetName}OptAlloc",
|
||||
"${targetName}Objc"
|
||||
)
|
||||
) {
|
||||
headersDirs += files("src/gc/stms/cpp", "src/gc/common/cpp", "src/mm/cpp")
|
||||
@@ -194,7 +197,8 @@ targetList.forEach { targetName ->
|
||||
"${targetName}CommonGc",
|
||||
"${targetName}SameThreadMsGc",
|
||||
"${targetName}Release",
|
||||
"${targetName}StdAlloc"
|
||||
"${targetName}StdAlloc",
|
||||
"${targetName}Objc"
|
||||
)
|
||||
) {
|
||||
headersDirs += files("src/gc/stms/cpp", "src/gc/common/cpp", "src/mm/cpp")
|
||||
@@ -212,7 +216,8 @@ targetList.forEach { targetName ->
|
||||
"${targetName}NoopGc",
|
||||
"${targetName}Release",
|
||||
"${targetName}Mimalloc",
|
||||
"${targetName}OptAlloc"
|
||||
"${targetName}OptAlloc",
|
||||
"${targetName}Objc"
|
||||
)
|
||||
) {
|
||||
headersDirs += files("src/gc/noop/cpp", "src/gc/common/cpp", "src/mm/cpp")
|
||||
@@ -229,7 +234,8 @@ targetList.forEach { targetName ->
|
||||
"${targetName}CommonGc",
|
||||
"${targetName}NoopGc",
|
||||
"${targetName}Release",
|
||||
"${targetName}StdAlloc"
|
||||
"${targetName}StdAlloc",
|
||||
"${targetName}Objc"
|
||||
)
|
||||
) {
|
||||
headersDirs += files("src/gc/noop/cpp", "src/gc/common/cpp", "src/mm/cpp")
|
||||
|
||||
@@ -272,6 +272,46 @@ extern KBox<KLong> LONG_CACHE[] = {
|
||||
{{}, 1},
|
||||
};
|
||||
|
||||
OBJ_GETTER(Kotlin_boxByte, KByte value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxShort, KShort value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxInt, KInt value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxLong, KLong value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxUByte, KUByte value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxUShort, KUShort value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxUInt, KUInt value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxULong, KULong value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxFloat, KFloat value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_boxDouble, KDouble value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
RUNTIME_NORETURN OBJ_GETTER(Kotlin_Throwable_getMessage, KRef throwable) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
@@ -67,6 +67,107 @@ void Kotlin_ObjCExport_resumeContinuationSuccess(KRef continuation, KRef result)
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
// Declarations from the "objc" module (see ObjCExportCollections.mm).
|
||||
OBJ_GETTER0(Kotlin_NSArrayAsKList_create) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER0(Kotlin_NSMutableArrayAsKMutableList_create) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER0(Kotlin_NSSetAsKSet_create) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER0(Kotlin_NSDictionaryAsKMap_create) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
KBoolean Kotlin_Iterator_hasNext(KRef iterator) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_Iterator_next, KRef iterator) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
KInt Kotlin_Collection_getSize(KRef collection) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
KBoolean Kotlin_Set_contains(KRef set, KRef element) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_Set_getElement, KRef set, KRef element) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_Set_iterator, KRef set) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableCollection_removeObject(KRef collection, KRef element) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableCollection_addObject(KRef list, KRef obj) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_MutableSet_createWithCapacity, KInt capacity) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
KInt Kotlin_Map_getSize(KRef map) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
KBoolean Kotlin_Map_containsKey(KRef map, KRef key) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_Map_get, KRef map, KRef key) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_Map_keyIterator, KRef map) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_List_get, KRef list, KInt index) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_MutableMap_createWithCapacity, KInt capacity) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableMap_set(KRef map, KRef key, KRef value) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableMap_remove(KRef map, KRef key) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableList_addObjectAtIndex(KRef list, KInt index, KRef obj) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableList_removeObjectAtIndex(KRef list, KInt index) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableList_removeLastObject(KRef list) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
void Kotlin_MutableList_setObject(KRef list, KInt index, KRef obj) {
|
||||
throw std::runtime_error("Not implemented for tests");
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#endif // KONAN_OBJC_INTEROP
|
||||
|
||||
Reference in New Issue
Block a user