ios - Xcode 5 : Unit Tests not running

标签 ios objective-c xcode unit-testing testing

我创建了一些测试用例,它们都通过了...那是因为它们没有运行。

从 Xcode,我得到:

Test Suite 'All tests' started at...
Test Suite 'All tests' finished at...
Executed 0 tests, with 0 failures (0 unexpected) in 0.00 seconds

The project (and unit test classes) build successfully.

All my test classes have MyApp_appTests as Target Membership selected. Production classes have MyApp_app & MyApp_appTests targets selected.

I verified the MyApp_appTests Target Build Settings (Bundle Loader & Test Host).

Bundle Loader (Debug): $(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp
Test Host (Debug): $(BUNDLE_LOADER)

我已经导入了 SenTestingKit.framework(通过 Targets Build Phases“Link Binary With Libraries”)。

我所有的测试都以 -(void)testThat... 开头

我还检查了几个 stackoverflow.com 问题:

stackoverflow.com/questions/8632254/xcode-4-2-cant-run-unit-test stackoverflow.com/questions/3608484/ocunit-tests-not-running-not-being-found stackoverflow.com/questions/16672616/ocunit-test-cases-not-running

和这篇文章:

twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/

我不知道去哪里找...非常感谢任何帮助!

最佳答案

对我来说,在测试目标的build设置中将“Wrapper extension”从“octest”更改为“xctest”

enter image description here

关于ios - Xcode 5 : Unit Tests not running,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18948427/

相关文章:

ios - TVML 自定义模板

ios - RestKit 自定义响应映射

objective-c - iOS - 旋转时 View 无法在 iPad 中正确加载

iphone - 这个 for 循环有什么问题 - 试图用 Tweet 对象填充数组?

ios - PHImageManager 的方法 "requestImageDataForAsset"在 Swift 中导致崩溃

ios - UITextField 和左 View 中的点击手势

objective-c - unicode表示形式叫什么?

swift - Cocoapod - [!] 无法找到 'Analytics' 的规范

ios - ios返回键只有一个文本字段被关闭

ios - 更改字形中单个字符的颜色