vendredi 4 décembre 2015

Xcode 7: Can't create a Swift command line tool with a unit test target

Oh, Xcode!

I'm stymied. If I create a Mac OS Cocoa app, I get a unit test target for free. But I want to write a command line tool (or even a library that I can link into a command line tool) and write some unit tests against it. I'll be darned if I can figure it out.

I've gotten far enough that I have a command line target, and a test target. I can "@testable import" my commnd line module and use the code in the test code with no errors in Xcode. However, as soon as I try to run my test (Cmd-U), I get a link error. None of the classes in the main module can be linked. What?

I've been messing with this for hours, and the Great Google has been no help. (I'm using Xcode 7, and Xcode 6 seems very different.) Can anyone help me?

Thanks.

Aucun commentaire:

Enregistrer un commentaire