Xcode 5.1打破了一些测试 [英] Xcode 5.1 breaks some tests
问题描述
自从更新到Xcode 5.1以来,我在尝试运行单元测试(XCTestSuite)时遇到错误.当我运行一个单独的测试方法时,在控制台上出现错误Error while reading test scope bundle
,但没有结果.当我运行测试文件的完整实现时,我看到:
Since updating to Xcode 5.1, I have been encountering errors while attempting to run unit tests (XCTestSuite). When I run an individual test method, I get the error Error while reading test scope bundle
on the console and no result. When I run the full implementation of the test file, I see:
Unable to get entitlements for client task. Error: Error Domain=NSPOSIXErrorDomain Code=-1 "The operation couldn’t be completed. (POSIX error -1 - Unknown error: -1)"
然后,测试似乎开始按预期运行.
Then the tests appear to start running as expected.
推荐答案
如果您有一个名为MyApp Tests的测试目标(请注意空格),请尝试将该目标上的产品名称更改为MyApp_Tests.产品名称将是MyApp_Tests.xctest,而不是MyApp Tests.xctest.
If you have a test target named something like MyApp Tests (notice the whitespace) try changing the product name on that target to MyApp_Tests instead. The product name will then be MyApp_Tests.xctest instead of MyApp Tests.xctest.
似乎这是路径问题.
这篇关于Xcode 5.1打破了一些测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!