xcodexcode4ocunit

Is there a way to "Test" current file in Xcode4?


Is there a way to "Test" current file in Xcode4?

That is if you are writting your 10th unit test, but rather than going TEST and having all unit tests run, you want to only trigger running those testing in the unit test file you are current in?


Solution

  • It looks like Xcode 4 is heading that way, but it doesn't work well:

    Unfortunately, you have to click individual checkboxes; there is no way to select the entire group, or even individual suites, and turn them off with a single click. Ideally, it would be nice to turn off everything, then reenable only the tests you want.

    As a workaround, you can set up a test target containing the infrastructure to run any test, but not containing any tests. Call it something like "Ad-hoc Tests". Then take the test suite you want and temporarily add it to the target. Use the technique described above to turn off all tests in your main test target.