Asynchronous unit testing Core Data with Xcode 6

The WordPress for iOS project had a number of unit tests using Core Data and a custom asynchronous test helper. The helper used a semaphore in a global scope and a bit of method swizzling to give a wait/notify mechanism. The problem with this solution was the global semaphore and poorly written tests causing a conflict. Tests would call the ending wait and previous tests running Core Data would fire off notifies causing a mismatch between the original test and the recipient of the message to pass by the current semaphore. ...

August 6, 2014 · 4 min · Aaron

If you run Unit Tests in Xcode

If you run unit tests inside of Xcode, you may wish to turn on the behavior to show the test results after they run. Go to Preferences in Xcode.Click on the Behaviors tab.Click on Succeeds.Check the box shown and select "Show" then "Test Navigator".Repeat step 4 for Fails as well.Now when your tests finish (failed or succeeded) you'll see the pretty green or red marks.

April 24, 2014 · 1 min · Aaron