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?
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?
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.
Pretty old post, but Xcode evolved since.
In Xcode6, got to Product > Perform Action
You'll see some other Test options, like Testing the current function.
The shortcut is Cmd-alt-ctrl-U
. Pretty difficult with a single hand if you're not a pianist.
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.
© 2022 - 2024 — McMap. All rights reserved.
Cmd-Option-Ctrl-U
will run a single test where your cursor is, andCmd-Option-Ctrl-G
will run all the last tests that were run. – Mencher