Ad

Our DNA is written in Swift
Jump

Radar: Xcode 5 unable to configure inline Unit Tests for iOS and Mac in parallel

The following issue is a head scratcher if you are trying to add unit tests to your project that both run on Mac and iOS. And if you like to use the new inline buttons for executing individual tests.

Filed as rdar://15085316 and Open Radar. The mentioned sample project is the UnitTestTest sample on our Radar Samples GitHub repo.

Summary

I have an Xcode project with a UnitTest target for iOS and a MacUnitTest for OSX. The unit tests work on the respective platforms when run via Test. But the new inline checks where you can run individual tests only work for one platform at a time.

Steps to Reproduce

  1. Look at the provided sample app
  2. for each of the 3 schemes run Test (CMD-U) – works.
  3. open MacUnitTest.m while having the MacUnitTest scheme selected
  4. click on the red x next to -(void)testExample

Expected Results

The individual test case should be executed based on the currently selected scheme.

Actual Results

You get the message

“The run destination My Mac 64-bit is not valid for tests you have chosen to perform. Please select a run destination which supports the tests that you wish to perform”.

Version

Version 5.0 (5A1413)

Notes

if instead of the source browser look at the test case navigator you see that the tests from the currently selected scheme are black and the others are gray. If you switch between the UnitTest and MacUnitTest schemes these adapt and you are always able to execute the tests via the small play buttons.

This leads me to believe that here is a bug, since the inline test launch buttons should always match the currently selected scheme, like in the test navigator.

Configuration

10.8.5 iMac 27″

Screen Shot 2013-09-26 at 10.42.18


Categories: Bug Reports

4 Comments »

  1. I can confirm this. I have a multi-platform project with a shared framework and shared tests. This behavior drives me crazy. Did still not test it with XCode 5.0.1 (GM)