Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading to Xcode 4 from Xcode 3 Broke Unit Tests

I have a core project that does not run as an application, its only "product" is to build and run a script. This project was created in Xcode 3, and was working great. Running a build would run the test script, no hassle.

Upgrading to Xcode 4, my script no longer runs. I haven't made any changes to the project, but there are obviously some differences. I checked out the build settings, and it looks like the script is piping results to /tmp/RunUnitTests.out, and the contents of this file are:

/Developer/Tools/RunUnitTests:68: note: RunUnitTests exited without running tests because TEST_AFTER_BUILD was set to NO.

Where should this TEST_AFTER_BUILD variable be set? Is there a way to do it in the UI that I can't find, or do I need to set it somewhere else?

(I'm assuming that since Xcode 4 has reached Gold Master, it's safe to discuss these things?)

like image 583
Craig Otis Avatar asked Mar 01 '11 02:03

Craig Otis


2 Answers

If you go to the project settings (click the folder icon, then the blue project file at the top), select your test target under TARGETS, select Build Settings, turn on All settings, find Unit Testing, The change "Test After Build" under the test target to yes.

like image 181
Hack Saw Avatar answered Oct 24 '22 06:10

Hack Saw


I believe you can also find that same flag(Test After Build) in the Unit Tests section of the Build Settings for each target. It defaults to 'NO' so it needs to be changed.

like image 4
tsand Avatar answered Oct 24 '22 07:10

tsand