Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use classes from another target for tests in XCTest

I use Xcode 6.1 to create a new project, and it comes with a Tests target. I am trying to use the classes defined in another demo target in the same project for tests. But how do I accomplish this (besides setting the class's target membership to both demo and tests targets)?

like image 585
yong ho Avatar asked Mar 12 '15 02:03

yong ho


1 Answers

Go to the source file in question and press option+command+1 to see the file inspector, and then select the appropriate targets in the "Target membership" section. Or, go to the target setting, click on "Build Phases" tab and add it to the "Compile Sources" section.

like image 190
Rob Avatar answered Oct 19 '22 07:10

Rob