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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With