【发布时间】:2015-10-07 03:10:28
【问题描述】:
我在 XCode 中的单元测试遇到了严重的问题。 我在 OS X Yosemite 和 OS X Capitan 上使用 XCode 6.4 Build 版本 6E35b。
结果我有这样的错误:
_finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Test session exited(-1) without checking in." UserInfo=0x7fbfea2b60b0 {NSLocalizedDescription=Test session exited(-1) without checking in.} didCancel: 1
堆栈上已经有一些帖子(例如,Xcode Server CI Bot Test Session exited(-1)),但没有找到解决方案。
我尝试从 XCode 和命令行运行单元测试,但我经常遇到这个错误。在最后一种情况下,我做了 3 个步骤:
1. Deleting everything from DERIVED_DATA_PATH
2. Installing pods
3. Ran unit-tests with command: xcodebuild test -scheme UnitTests -destination 'platform=iOS Simulator,name=iPhone 5s,OS=8.2' -derivedDataPath 'temp-build-dir' 2>&1
这对我来说是一个很大的麻烦,因为我在带有 UI 测试的常见自动构建流程中使用这些测试,如果它们失败,整个流程就会失败。
在 XCode 6 的发行说明中,Apple 提供了有关该错误的信息,他们的解决方法是简单地重新运行测试。这对我来说是不可接受的,因为它们会与其他测试一起自动运行,并且重新运行它们直到它们通过或简单地运行而没有错误似乎是个坏主意。
【问题讨论】:
标签: ios objective-c xcode unit-testing ios-simulator