Automatically Running Unit Tests

One additional tip that I wanted to add to the post on Unit Testing with OCUnit. If you make the UnitTests target a dependent of the application target it will get run automatically each time you build the application target. The easiest way to create the dependency is to drag the UnitTests target onto the TheElements application target.

Alternatively right-click on the target (TheElements) and use Get Info to view the target settings. In the General build tab the top window shows the direct dependencies of the target. Click the + button and select the UnitTests target from the list of available targets (in this case there is only one).

Now whenever you build the target TheElements the UnitTests target also gets run without you having to remember to do it.

Never miss a post

iOS Size Classes Cheat Sheet

Subscribe and also get my free iOS Size Classes Cheat Sheet

Success! Now check your email to confirm your subscription and download your free guide to iOS Size Classes.

There was an error submitting your subscription. Please try again.

Unsubscribe at any time. See Privacy Policy
Archives Categories