我创建了一些测试用例,它们都通过了......那是因为它们没有被运行。
从 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
项目(和单元测试类)构建成功。
我的所有测试类都选择了 MyApp_appTests 作为目标成员资格。生产类选择了 MyApp_app 和 MyApp_appTests 目标。
我验证了 MyApp_appTests 目标构建设置(捆绑加载程序和测试主机)。
Bundle Loader (Debug): $(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp
Test Host (Debug): $(BUNDLE_LOADER)
我已经导入了 SenTestingKit.framework (通过目标构建阶段“链接二进制文件与库”)。
我所有的测试都从-(void)testThat...
我还检查了一些 stackoverflow.com 问题:
stackoverflow.com/questions/8632254/xcode-4-2-cant-run-unit-test https://stackoverflow.com/questions/8632254/xcode-4-2-cant-run-unit-test
stackoverflow.com/questions/3608484/ocunit-tests-not-running-not-being-found https://stackoverflow.com/questions/3608484/ocunit-tests-not-running-not-being-found
stackoverflow.com/questions/16672616/ocunit-test-cases-not-running https://stackoverflow.com/questions/16672616/ocunit-test-cases-not-running
和这篇文章:
twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/ http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/
我不知道在哪里寻找...非常感谢任何帮助!