lurscher
lurscher

Reputation: 26983

running tests on xcode 4.3

I'm using Xcode 4.3 and i'm not getting how to run the tests, or at least, how the see the test results, failed or passed.

I've a project with two targets, foo and fooTests. The tests are the default implementation; a simple tearDown and setup function and a testExample method with a STFail(@"not implemented")

where i'm supposed to see this message? on the scheme dropdown, there seems to be only foo. What i need to do to run the fooTests target and see output?

Upvotes: 3

Views: 3338

Answers (4)

Joel B
Joel B

Reputation: 746

I solved this by clicking on the "Run" checkbox in the Edit Scheme dialog. On the left there's a list of tabs. Choose "Build". Then there's a list of actions ("Analyze", "Test", "Run", "Profile", etc) on the right-hand side. Make sure "Run" is checked.

Then press "OK" and then Clean and Build your project.

Upvotes: 9

Swift Dev Journal
Swift Dev Journal

Reputation: 20088

Eimantas' answer covers running the tests. Open the log navigator to see the results. More detailed information is available in the following article:

Setting Up OCUnit Unit Testing in Xcode 4

Upvotes: 0

WendiKidd
WendiKidd

Reputation: 4373

You'll need to create a new scheme to run a different target. Click the left portion of your Schemes bar (top left hand corner) and you should get a drop-down menu where "New Scheme" is an option--create a new scheme and choose fooTests as the Target.

Upvotes: 0

Eimantas
Eimantas

Reputation: 49354

From the menu Product->Test or the Cmd+U (+U) keyboard shortcut will run the test for foo target.

Upvotes: 5

Related Questions