Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Native tests runner for iOS #1620

Closed
thevery opened this issue May 22, 2018 · 2 comments
Closed

Native tests runner for iOS #1620

thevery opened this issue May 22, 2018 · 2 comments

Comments

@thevery
Copy link

thevery commented May 22, 2018

Right now it is possible to write common tests and run them on JVM with kotlin-test-junit (I've tried @RunWith(JUnit4::class) class SomeTestJava: SomeTestCommon() and it works), but is there are any way to do this for iOS?

@ilmat192
Copy link
Contributor

Kotlin/Native supports the kotlin.test package so you can run the common tests if they use this package. To do this, you need to create an executable passing -tr as an additional compiler option (see https://github.com/JetBrains/KotlinMultiplatformPlayground/blob/master/native/build.gradle). Currently Gradle plugin doesn't provide a testing DSL but this is in short-term plans.

If you want to runt the test executable on iOS, the UIKit sample may be useful for you: https://github.com/JetBrains/kotlin-native/tree/master/samples/uikit. It shows how to create an iOS application fully on KN and load the executable to the device.

@thevery
Copy link
Author

thevery commented Jun 19, 2018

iOS test executable implemented in this sample:
Kotlin/kmp-basic-sample#1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants