我创建了一些测试用例,它们都通过了...那是因为它们没有运行。
从 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”
关于ios - Xcode 5 : Unit Tests not running,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18948427/