Xcode5:创建新的测试目标 [英] Xcode5: creating new testing target
问题描述
我正在尝试在我现有的 iOS+Mac 项目中创建我的第一个 XCTestCase.我创建了一个新的测试类,我看到它在我的项目中为我创建了一个新的测试目标,但新方案没有我现有目标中的链接库和源代码文件.它只是从现有目标共享方案,但没有任何项目细节.我不想将每个源文件和框架库添加到新的测试目标中.有没有办法简单地创建一个新的测试目标,它是现有目标的克隆?或者将所有源文件添加到我的目标中而不是
I'm trying to create my first XCTestCase within my existing iOS+Mac project. I created a new test class, and I see that it created a new test target for me in my project, but the new scheme has none of the linked libraries and source code files from my existing target. It just shared the scheme from the existing target, but none of the project details. I don't want to go add each and every source file and framework library into the new test target. Is there a way to simply create a new test target that is a clone of an existing target? Or add all source files into my target without it being
推荐答案
正确设置后,测试包将链接到您的应用程序.您不应将任何生产代码放入您的测试目标中,而应仅放入测试代码.
When set up correctly, the test bundle is linked against your app. You shouldn't put any production code into your test target, only test code.
这篇关于Xcode5:创建新的测试目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!