views:

706

answers:

3

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?

+1  A: 

In case someone else comes across this, here's what I finally got working.

I made a local copy of the code, then reverted the entire codebase back to a previous commit in my Git repository. That clean checkout could still run tests just fine. I then reintroduced my changes in file by file, checking that unit tests worked after each incremental merge.

I expected to hit some point when the unit tests stated failing, but it never came. I merged all the changes in and the unit tests were still running fine.

Obviously, this isn't going to be of help to anyone who doesn't have a SCM system with a working copy to revert to. In that case, making a clean project and pulling your code over would be the best option.

TALlama
+2  A: 

If Xcode hangs during the build (the build results window shows 'Running custom shell script' but stalls there), select the unit test target and click 'Get Info'. Then select the Properties tab and clear the text field for 'Main Nib File' and clean the target.

Clicking 'Build and Go' should now successfully run the tests.

Brendan Berg
+1  A: 

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

dmaclach