Hi! Any idea how can I run ios tests in my common ...
# ios
f
Hi! Any idea how can I run ios tests in my common module with cocoapoads from xcode?
b
Can you clarify more what you're trying to do?
f
Yes! I have a shared module that exports the native code through Cocoapods and this module is consumed by xcode. There are some tests there it can’t run with a simple Gradle task due to this integration.
I can’t run something like below in a simple command line
Copy code
./gradlew runiOStests
I will give a example
This task will fail because of cocoapods integration
I would like to know if there is a way to run them 🙂
b
I'm not sure you can expose tests to be run from an Xcode project. @kpgalligan?
k
Sort of. We’ve done it in the past. You can pass
-tr
to the kotlin native compiler, which will create the actual test runner: https://github.com/JetBrains/kotlin-native/blob/76e3ad7a5c4482e499fb200a45ad99cb78d00048/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt#L25
Then you can call that test runner entry point from Xcode, or more specifically an XCtest
However, I haven’t set that up with the cocoapods plugin
f
i’m gonna try that!
k
Would need to dig for a while to find the test runner call, although the bigger job is doing be getting the test build to make an actual framework that you can use
f
Yeah, i decided to remove CocoaPods integration in order to have some tests running. Thanks!