title: Setup a TestProject with XCTest with two test targets for iOS and OSX and shared Unit Tests
body: <p>I would like to have a single project for Unit testing a library which executes the unit tests on Mac OS X and iOS, in two separate test targets within one Xcode project. The Unit Test files shall be shared.</p>
  
  <p>It seems this is impossible, or is not intended to work, or otherwise, reveals a bug:</p>
  
  <p>While it's possible to run the complete Unit Test for each iOS and Mac OS X (via command Product -> Test), it's not possible to run <em>individual</em> test methods by clicking on the <em>diamond</em> in the gutter:</p>
  
  <p><img src="https://i.stack.imgur.com/HGanU.png" alt="enter image description here"></p>
  
  <p>When doing this, Xcode opens an error sheet, telling:</p>
  
  <blockquote>
    <p><strong>The run destination My Mac 64–bit is not valid for tests you have chosen to perform.</strong></p>
    
    <p>Please select a run destination which supports the tests that you wish to perform.</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/qIqEW.png" alt="enter image description here"></p>
  
  <p>I figured, the problem seems to be that in one project with two targets the shared Unit Test files have to be associated to iOS <em>and</em> Mac OS X test targets. That is, the "Target Membership" for a particular Unit Test file is set for the iOS and the MacOSX target.</p>
  
  <p>Starting individual tests from the diamond in the gutter seems to work only, when associating shared Unit Test files to only <em>one</em> target.</p>
  
  <p>Has anybody managed to get this working? What would be an alternate solution?</p>