How to add dependency to `XCTest` framework? Just ...
# kotlin-native
t
How to add dependency to
XCTest
framework? Just
Copy code
iosX64 {
        compilations.getByName("main") {
            val xctestinterop = cinterops.create("XCTest")
        }
    }
would work?
d
Do you have a
XCTest.def
file?
t
no 😞
seems I need to create it
d
Yeah
r
I tried doing this sometime last fall and never quite figured out the right setup to get it to work. I think I was having trouble figuring out what headers needed to be included in the def file but it's been a little while now.
This was my setup (that didn't work right) https://github.com/russhwolf/xctest-playground
t
how cinterop searches for xcode platform libraries? Straightforward def file is not working:
Copy code
depends = CoreFoundation
language = Objective-C
package = platform.XCTest
modules = XCTest

compilerOpts = -framework XCTest
linkerOpts = -framework XCTest
error:
Copy code
fatal error: module 'XCTest' not found
I see, it is included into konan distribution...
d
That's convenient.