You need to edit the scheme for your main application target.
- Click the scheme selector
- Click Edit scheme
- Make sure the scheme you use for your actual application is selected
- In the sidebar, you have “Build”, “Run”, “Test”, etc. Click the “Test” entry.
- In the table view, click the + at the bottom and select your test target, click add.
The “Test” option in the product menu is no longer grayed out.