Xcode 6.3: Renaming app target breaks linking for test target due to hard coded Test Host value

Originator:andrew
Number:rdar://21139630 Date Originated:28-May-2015 02:08 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.3 (6D570)
Classification:Other Bug Reproducible:Always
 
Summary:

Renaming the app target breaks linking following a clean build of the associated Tests target, due to a hard coded Test Host Value in the unit tests target.

Steps to Reproduce:

1. Create a new Swift project (we’ll call ours LetsBreakTestHostForFunAndProfit)
2. Verify unit test target compiles and runs successfully
3. In the project inspector, rename the main app target to RenamedTarget
4. Hold down Alt and do Product >> Clean Build Folder… and select Clean
5. Cmd+U to build and run the tests target
6. Observe linking fails with attached output (see linking-failure.txt inside attached zip)
7. Return to the Project inspector and view the test target
8. Locate the Test Host value
9. Observe it is still hardcoded to the old app target name:

$(BUILT_PRODUCTS_DIR)/LetsBreakTestHostForFunAndProfit.app/LetsBreakTestHostForFunAndProfit

10. Edit Test Host to:

$(BUILT_PRODUCTS_DIR)/RenamedTarget.app/RenamedTarget

11. Cmd+U to build and run tests target
12. Observe compilation/linking/running completes OK now


Expected Results:

I would expect renaming the app target to not break the tests target.

Actual Results:

Unit tests target fails to link after a clean build until the user goes in and manually hacks the unit test target’s Test Host field to remove references to the old app target name.

Regression:

Unsure - I’ve successfully changed app target names before without problems.

Notes:

N/A

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!