Re: Link error in unit testing config ?
Re: Link error in unit testing config ?
- Subject: Re: Link error in unit testing config ?
- From: Erik Stainsby <email@hidden>
- Date: Thu, 01 Nov 2012 20:09:04 -0700
Thanks Damian,
I had assumed (wrongly) that the build settings would be duplicated for me. Apparently not.
So now I have a simple: STFail(@"STFail invoked");
in my - (void) testAppDelegate:
which never fails. (Urk?!)
Also I see that the log for the Test MyAppTests does not complete until I quit the run. That's not correct behaviour is it?
Sorry to trouble you with these rather newb questions. I just feel it is past time I got over the hurdle and start controlling my code better.
Thanks,
Erik
On 2012-11-01, at 5:33 PM, Damian Carrillo <email@hidden> wrote:
> In your test target, ensure that you link against the AddressBook framework. Select your test target, go to the "Build Phases" tab, then add AddressBook.framework to the section under "Link Binary With Libraries".
>
> On Nov 1, 2012, at 7:16 PM, Erik Stainsby wrote:
>
>>
>> I'm new to using ocunit and to unit testing in general. (If there is a better place to ask this question , please tell me so.)
>>
>> Part of my unit testing involves reading from the ABAddressBook. I can;t seem to find the right place to #import or the correct type of reference to the <AddressBook/AddressBook.h> header. I've got it in the .pch right now and it still raises this error when I run the tests Cmd-U.
>>
>>
>> Build target SuperContactsTests
>>
>> Ld /Users/erik/Library/Developer/Xcode/DerivedData/SuperContacts-cdbathheyljueebikofkttovkdij/Build/Products/Debug/SuperContactsTests.octest/Contents/MacOS/SuperContactsTests normal x86_64
>> cd /Users/erik/Development/Production/SuperContacts
>> setenv MACOSX_DEPLOYMENT_TARGET 10.8
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/erik/Library/Developer/Xcode/DerivedData/SuperContacts-cdbathheyljueebikofkttovkdij/Build/Products/Debug -F/Users/erik/Library/Developer/Xcode/DerivedData/SuperContacts-cdbathheyljueebikofkttovkdij/Build/Products/Debug -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/erik/Library/Developer/Xcode/DerivedData/SuperContacts-cdbathheyljueebikofkttovkdij/Build/Intermediates/SuperContacts.build/Debug/SuperContactsTests.build/Objects-normal/x86_64/SuperContactsTests.LinkFileList -mmacosx-version-min=10.8 -bundle_loader /Users/erik/Library/Developer/Xcode/DerivedData/SuperContacts-cdbathheyljueebikofkttovkdij/Build/Products/Debug/SuperContacts.app/Contents/MacOS/SuperContacts -fobjc-arc -fobjc-link-runtime -framework SenTestingKit -framework Cocoa -o /Users/erik/Library/Developer/Xcode/DerivedData/SuperContacts-cdbathheyljueebikofkttovkdij/Build/Products/Debug/SuperContactsTests.octest/Contents/MacOS/SuperContactsTests
>>
>> Undefined symbols for architecture x86_64:
>> "_OBJC_CLASS_$_ABAddressBook", referenced from:
>> objc-class-ref in SuperContactsTests.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>>
>> _______________________________________________
>> 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
>
_______________________________________________
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