Re: SenTestingKit not found for Test file relocated across targets
Re: SenTestingKit not found for Test file relocated across targets
- Subject: Re: SenTestingKit not found for Test file relocated across targets
- From: Timothy Reaves <email@hidden>
- Date: Thu, 18 Dec 2008 19:11:37 -0500
On Dec 18, 2008, at 2:35 PM, Stuart Malin wrote:
I have a Tests target in my project that is set up for Unit Tests.
It had a single tests file that compiled and ran fine. I added a new
file, and the compiler reported an error in the .m file that in the
included .h file that the SenTestingKit was not found. I thought
this quite odd, as the existing test file worked just fine. In
looking into this, I discovered that I had inadvertently added the
new test file to the wrong target (not the Tests target). So I did
Get Info on the new test's .m file, and changed its target
membership. But this did not make the error go away. I couldn't
fathom what else to do, so I created yet a new test file, and added
this to the Tests target via the New File Assistant. This third test
file did not have the error. So I renamed it, moved my test code
from the second file into the the third, and deleted the second
file. This compiles fine. So, while I have fixed my problem, I am
stumped: why didn't changing the .m file's target membership fix the
problem? Should it have? Is there yet something else I need to do if
I move a file from one target to another? (BTW: I had validated that
when I changed the target, the .m file did appear in the Tests
target's Compile Sources build phase). Sorry for being wordy and
hope my description is clear enough.
_______________________________________________
This is a very common mistake people make; I make it still once in a
while. The easy solution is to select your folder that contains the
tests (in the Groups & Files tree), and make sure that the test target
is the active target. Now in the Details table, simply check the box
under the target column (the far right one by default). Also uncheck
for the Application target. That's it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden