Do I need to manually add each * .m file to my unit test target, when necessary?

I use Unit Testing in Xcode 4. I add * .m application files to the unit test target “compiled sources”, as I refer to them so that unit test creates / runs.

Is there a better way here?

Note. I just tried adding an application to the unit test targets of the target, but that didn't seem to work (some build errors still occur).

+5
source share
3 answers

Yes, you will need to add each .m file needed for your unit test purpose.

This will include them in the target compilation and linking phases.

+2

Xcode 4 : , , , .

Xcode 4 . , unit test, . , .

, , , .

+8

testTarget SWIFT- Obj-C

It would be enough to make the testTrget schema, but this one off: product → schema → editing schema → build tab: only checked Check nothing more.

IMPORTANT: You do not have to include every .m file in the target test. Just add headers in testTarget-Bridging-Header.h

Note: if you check more in the schema or INCLUDE.m file in testTarget, you may get header conflicts.

0
source

All Articles