I know how to do Unit Test on iPhone - the logic tests which run during build phase of the "iPhone Unit Test Bundle".
I know how to detect memory leaks using instruments - in XCode, Menu->Run->run with perf tools->Leaks.
How do I do both? I want to run the unit tests and detect memory leaks in them. If I try to simply select unit-test bundle as target and then "Menu->Run->run with perf tools->Leaks" I get the app loading in simulator but the unit test is not run.
The best I could come up with is include the same unit-test files into my real app target and simply invoke them all from the app itself at runtime. Any better ideas?