[K/N][test] Support library for running Kotlin/Native tests with XCTest

This change adds a library with cinterop that has XCTest wrapper around
Kotlin/Native tests (that are @kotlin.test.Test marked methods).
This library can be compiled with either test code using the option
`-produce test_bundle` to make a loadable test bundle or used inside
the existing ObjC/Swift tests if compiled to a framework.

The basic idea is to make XCTest be able to resolve separate test cases
and correctly show them in test reports. This was achieved by wrapping
test cases with dynamically created invocation methods. Test listeners
are integrated with XCTest Observation to make it possible to have 
the same ability to report with GTest or TeamCity logging.

Gradle build files use MPP Gradle plugin and use a bootstrap version
of K/N. Property `kotlin.native.home` was moved to the kotlin-native
subproject to not override this project's K/N distribution, that is
being used by the KGP with the same property.

This is a part of ^KT-58928


Merge-request: KT-MR-13268
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This commit is contained in:
Pavel Punegov
2024-01-18 15:04:37 +00:00
committed by Space Team
parent e3ddc843bc
commit 6b409d87f5
12 changed files with 639 additions and 8 deletions
+1
View File
@@ -35,6 +35,7 @@
<trust group="org.jetbrains.kotlin" name="kotlin-gradle-plugin-model" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-klib-commonizer-api" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-klib-commonizer-embeddable" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-native-prebuilt" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-native-utils" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-project-model" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-reflect" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>