Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am trying to run unit tests for Mac application in xcode 5.0 .

The unit tests run fine if I have the sandbox disabled but as soon as I enabled the sandbox the tests are unable to run, failing with error loading bundle (IDEBundleInjection.c: Error loading bundle).

I've seen a few other reports about this error and looks like the general assumption is that it won't work. The suggested workaround is to create a new configuration in xcode with sandboxing disabled and running the tests with that configuration.

This works, of course, but it seems like a poor workaround since it will be running the tests in a different environment than the real application normally would and potentially missing on a whole category of bugs resulting from different permissions, directories etc.

I can hardly believe that Apple intended developers to disable sandboxing for testing, seems very short sighted. Has anyone figured out a better solution for running unit tests for an application that is intended to run in sandbox mode?

share|improve this question
    
Isn't a unit test related to an individual class/method in class? How does it relate to the entire app? – trojanfoe Oct 17 '13 at 12:03
    
The tests themselves are targeting individual units but they are all compiled into a test bundle which is injected into the loaded application bundle. – danielv Oct 17 '13 at 12:34
    
Ah, I see. I haven't used the Xcode 5 unit test framework. – trojanfoe Oct 17 '13 at 12:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.