Kotlin-native: [Improvement] Better test integration with IntelliJ

Created on 21 Mar 2019  路  4Comments  路  Source: JetBrains/kotlin-native

It's not too difficult to get test runners setup for native targets, but it's very difficult to debug them. With the iOS test runner for example, it's easy enough to write a gradle task that runs the tests and does some reporting, but debugging tests and interacting with them in IntelliJ is difficult. Two things would improve this:

  1. While you can have them wait for a debugger to attach, and then manually attach lldb, it'd be much better if you could run the tests in the debug configuration in IntellIj and hit breakpoints that were set in the GUI.
  2. It would also be nice if tests that passed/failed showed up in the IntellIj test window, similar to how they do when running common tests using Android's test runner (e.g. the testDebugUnitTest gradle task)

Solving 1. might mean also solving #2578, but if that's too difficult in the near term, solving it for the macos test runner (generated by the mpp plugin) might provide the template that those of us who are using a custom iOS test gradle task could use to adjust our custom ios test runner tasks.

Most helpful comment

Yes, this is planned for upcoming IDE work.

All 4 comments

Yes, this is planned for upcoming IDE work.

@olonho following up on this, I can do xcrun simctl spawn --wait-for-debugger -s 'iPad Air 2' build/bin/iosSim/debugTest/test.kexe (trying to debug a unit test), but then there's no K/N debugger in IntelliJ I can tell to attach to this. Do you have any advice here?

I downloaded IntelliJ Ultimate + K/N Debugging plugin. It looks like it only supports specific target types.

This is really an mpp + IDEA problem. Filed here: https://youtrack.jetbrains.com/issue/IDEA-228681

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tarek360 picture tarek360  路  4Comments

SBNTT picture SBNTT  路  4Comments

msink picture msink  路  4Comments

brettwillis picture brettwillis  路  4Comments

jonnyzzz picture jonnyzzz  路  4Comments