0

Just turned on unit testing on an existing project, follow all the instruction here, here will no luck.

Any hints? There are tests that work, but I was testing with a category class instead of a totally custom class.

I should also mentioned that I am using CocoPods which seems to compile fine in the test target. Oh, and I am using xcode 4.6

Here is the relevant error msg:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_UIHelpers", referenced from: objc-class-ref in EventHashTest.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

4

1 回答 1

1

What's happening here is that your implementation (.m) for UIHelper can't be found by the UnitTest. You need to make sure your UIHelper.m is part of your app or your unit test target. See how the UIHelper.m is indicated as having target membership by the text box in the ride pane:

enter image description here

And, the unit test target is able to find this implementation b/c this target depends on the app target. See in the middle pane where the app is listed as a target dependency:

enter image description here

于 2013-08-24T00:35:10.903 回答