In Xcode, you can create objects that have direct dependencies on each other. There are a number of non-product goals that can help in the Other category when adding a new goal, depending on how simple or complex your setup is. Creating specific goals for running unit tests that are directly dependent on the project’s main goal is very common and documented by Apple and on several blogs.
In your situation, however, you may have to tune in a lot to the new goal of testing the user interface, but after setting it up it will be very easy to maintain. Without knowing your exact situation, it is impossible to give you a step-by-step answer, but here are the general recommendations (customization according to your situation):
- Make a copy of the original goal, as most of your settings will be the same.
- Select a new target and open the inspector (⌘I)
- In the Direct Dependencies section, click the + button and select the main target.
- Set up a new goal as desired, with additional documentation / source / rules or whatever.
If you prefer to drag things, you can also drag the original target (from the Goal disclosure triangle) to the new target, and it will automatically adjust the dependency.
Now select the target audience as the active target and it will always build with these rules. In addition, if you add / modify the source code in the main target, it will be rebuilt correctly when creating the test target ... do not forget to add the source file to the test target. I suggest taking some time to read the various Xcode docs and play with the many targeted templates available ... ultimately, it really helps make the use of the product much more efficient. There are many great things you can do quite easily in Xcode if you know how, even with very large or complex projects.
Jason coco
source share