I have written a static library to re-use some code between iOS projects, let's call it MyLib
.
While MyLib
has good unit test coverage, it interacts heavily with external resources, and I'd like to make sure that it does the right then when it's hooked up with other pieces of an actual application. In short, I would like to add an application test target to my static library in addition to the unit test target. No drama there.
In thinking about the general setup, I also wondered if it wouldn't be a good idea to ensure that my library's application test target linked against the actual libMyLib.a
binary artifact, thereby putting that step of the process under test as well.
So two questions:
Is this even necessary? Is there any significant risk that the final
libMyLib.a
binary product could behave differently than the series of compiled.m
files that my unit tests already exercise? (Possible answer would be that it guards against the accidental exclusion of one of those.m
files in the eventual build target).How would one make certain that the application test target was linking against
libMyLib.a
? Is this configurable within the build settings? Is any custom build scripting necessary?
I apologize in advance for the basic question if this is common knowledge, I'm slowly coming up to speed on build process, linking, etc. in general, not just how it is implemented using Apple's SDKs.