0

On my MAC mini my project can run SenTestingKit.framework tests. Got a MACBook Pro with 10.7.4 with . For the same project I cannot run unit tests because SenTestingKit.framework is not to be found. I copy from the Mac mini to "/Applications/Xcode.app/Contents/Developer/Library/Frameworks". Add to each target Framework Search Paths:
$(inherited)
"$(DEVELOPER_LIBRARY_DIR)/Frameworks"

This resolves to "/Applications/Xcode.app/Contents/Developer/Library/Frameworks".

I can add to the project so it compiles. I can't run Product > Test because of this link error :

Undefined symbols for architecture i386:
  "_OBJC_METACLASS_$_SenTestCase", referenced from:
      _OBJC_METACLASS_$_Field_MobileApplicationTests in Field_MobileApplicationTests.o
  "_OBJC_CLASS_$_SenTestCase", referenced from:
      _OBJC_CLASS_$_Field_MobileApplicationTests in Field_MobileApplicationTests.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Andy in Boulder
  • 441
  • 1
  • 4
  • 7

1 Answers1

0

I had the same problem by using my class that want to be tested. I got this error:

Undefined symbols for architecture i386:
"_OBJC_METACLASS_$_JsonDictParser", referenced from:
   _OBJC_METACLASS_$_MainData in MainData.o
   _OBJC_METACLASS_$_JsonObjectClass in JsonObjectClass.o
"_OBJC_CLASS_$_JsonDictParser", referenced from:
   _OBJC_CLASS_$_MainData in MainData.o
   _OBJC_CLASS_$_JsonObjectClass in JsonObjectClass.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have created an object from my class that I want to test and forgot to tell the „Target Membership“. So I make sure I checked the test class.

E.g. I want to use JsonDictParser class for testing in my JsonTestLogicTest class. So I focus the JsonDictParser.m file, clicked the File Inspector at the right side on the main window, selected Target Membership and checked my class where my testcases are in JsonTestLogicTest.

Or open the .xcodeproject file in the Project Navigator, select the target with the test methods > Build Phases > Compile Sources and add the .m file which includes your classs that you want to test.

nalply
  • 26,770
  • 15
  • 78
  • 101
Jimi Jimbo
  • 31
  • 5
  • My error is it can't find SenTestCase which is in SenTestingKit.framework. SenTestingKit.framework is in Link Binary with Libraries in Build Phases for the test target. – Andy in Boulder Sep 11 '12 at 22:43