lundi 27 juillet 2015

Can I import an iOS or OS X test target (dylib?) into my code using the command line?

I'd like to build a tool that examines iOS or OS X test suites. Accordingly, I'd like a way to programmatically access the test objects.

My understanding that test targets in Xcode projects create dylibs. If so, how can I create, link, and import one such that I can access the classes within my own code?

Looking at ~/Library/Developer/Xcode/DerivedData/MyApp-somehash/Build/Products/<release-platform>/MyAppTests.xctest, I see a binary file called <testtarget>. file MyAppTests gives:

MyAppTests: Mach-O 64-bit bundle x86_64

Using Swift (xcrun swiftc) or Objective-C (xcodebuild?), how can I import this file into my code, assuming that I understand correctly that this is a dylib?

Aucun commentaire:

Enregistrer un commentaire