2

I have enabled test coverage with no problem using the Generate Test Coverage Files and Instrument Program Flow with the fopen$UNIX2003 and fwrite$UNIX2003 hack.

But the problem is, when you use XCode to run tests it ends up launching the simulator which launches your app. When that happens the output for the test coverage is not truly correct because it thinks certain parts of the code are touched because they are executed when the app launches, not because a test touched them.

Is there a better way to see what code was actually touched by a test?

EDIT:

So not really an answer to my question, but a somewhat "solution" that will at least get better coverage numbers can be found here: Run logic tests in Xcode 4 without launching the simulator

Community
  • 1
  • 1
njkremer
  • 269
  • 3
  • 11
  • I encountered the same situation. Logic tests don't have this problem, but what happens if you really need to write application tests? I guess one solution is to move those kind of tests in a separate target. Looking at the way application tests work I don't think there's any way to get accurate coverage reports for them. – Mihai Damian Oct 22 '14 at 19:42
  • Following by a SOLID principles, we could separate each of the dependencies in the separated project. Each of this projects would have their own tests. Each of them would be executed separated and would not interfere with others. – Aleksei Minaev May 05 '17 at 10:53

0 Answers0