Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5.1 breaks some tests

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.

like image 203
Joel Fischer Avatar asked Mar 11 '14 17:03

Joel Fischer


2 Answers

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.

Seems like this is a path issue.

like image 133
hjaltij Avatar answered Oct 20 '22 12:10

hjaltij


I couldn't get it to run single tests by using hjaltij's method but adding a new test target worked for me

TestNavigator > Add New Test Target (Plus Button)

Then create new test classes under this target

like image 42
Matt Key Avatar answered Oct 20 '22 12:10

Matt Key