0

I'm using OCMOCK for class mocking and lcov for code coverage. For OCMock to work i have to set -ObjC flag under "Other linker flag" and for lcov to generate code coverage for .m file i need to add that file under TestTarget -> Compile Source but if i do this its giving me below errors

"duplicate symbol _OBJC_CLASS_$_ClassName in" 

"duplicate symbol _OBJC_METACLASS_$_Class Name in"

"duplicate symbol _OBJC_IVAR_$_ClassName._sharedCoAPEngine in:"

Is there any work around for this, by which i can use lcov with OCMock??

Allison
  • 2,213
  • 4
  • 32
  • 56
Varun Mehta
  • 1,733
  • 3
  • 18
  • 39
  • This happens when you add import same file twice. Recheck your code. – Bista Feb 01 '16 at 05:13
  • Yes! Its linking my file twice one with -ObjC flag for OCMock and other by adding .m file under TestTarget -> Compile Source for lcov code coverage report generation. – Varun Mehta Feb 01 '16 at 05:19
  • 2
    OCMock is available in Cocoapods: https://cocoapods.org/?q=ocmock. To avoid library conflicts & dependencies problem, use Cocoapods – Raptor Feb 01 '16 at 07:19

0 Answers0