Xcode 9: Test Classes and Test Callers menu items in Related Items menu don't work

Originator:brandon
Number:rdar://38978351 Date Originated:2018/03/28
Status:Open, Duplicate of 38938839 Resolved:
Product:Xcode Product Version:9
Classification:Bug Reproducible:Always
 
Summary:

The Xcode 9 release notes included this in the General > New Features section:

> Added Test and Tests as suffixes for determining file counterparts used in navigation and in the Assistant Editor. (28981734)

This is a great new feature that makes it much easier to navigate to and edit code and test counterparts at the same time. Unfortunately I'm unable to get this to work. It's not clear if I'm misunderstanding how it should work or if there is a bug.

This may be related to rdar://38938839

Steps to Reproduce:

1. Create a new project in Xcode with the iOS Single View template
  - include Unit Tests
  - Swift language
2. Add an instance method to the generated ViewController class
3. Rename the generated test class and file to ViewControllerTests, following the guidance of the Xcode 9 release notes
3. Add a test method to ViewControllerTests which invokes the ViewController instance method that you added in step 2
4. Navigate back to ViewController.swift
5. With the cursor inside the new instance method, note that there are no items in the Test Classes or Test Callers menu item in the Related Items menu (shown by clicking the 4-squares icon in the top left of every editor view)

Expected Results:

It's possible to navigate to a source file's counterpart test class or a method's test callers with the Related Items menu.

Actual Results:

These menu items never contain any other source file menu items.

Version/Build:

Version 9.2 (9C40b)

Configuration:

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!