Search code examples
iphoneunit-testingocunit

iPhone Unit Tests Hang; Fail to Call -applicationDidFinishLaunching:


I have unit tests set up for my iPhone project built using the Google Toolkit for Mac framework on top of OCUnit. I have a dependent project called "Unit Tests" that builds and runs the tests as needed.

But then it all stopped working, for no reason that I can fathom. Suddenly, my "Unit Tests" executable launches and just sits there, waiting, forever. It never gets as far as the Application Delegate's -applicationDidFinishLaunching: method, which is what calls the actual unit tests. Inserting an NSLog into the delegate's -init method tells me that that method gets called, but the application never "finishes" launching.

If I modify the shell script that runs the "Unit Tests" executable and take out the -RegisterForSystemEvents argument, the executable exists immediately (it runs no tests) and gives me the following message:

Terminating since there is no system event server.
(Run the EventPump or pass the argument "-RegisterForSystemEvents" if you want to run without SpringBoard.

Since it terminates when I remove that argument, I'm curious what exactly that argument does and how, since it would seem to be causing the hang. But since no tests run without it, I need to determine how I can get it working again. However, Google doesn't provide links to anything relevant to the current situation, and nothing in the dev docs is helpful.

Any ideas?


Solution

  • We fixed this issue as of this morning. Top of tree GTM should not hang anymore. It has to do with the delegate being switched before it had a chance to get the applicationDidFinishLaunching event. More details in this thread:

    http://groups.google.com/group/google-toolbox-for-mac/browse_thread/thread/513a3252d655e1e3