How to flush coverage data when my test cause app crash - For ios app

Posted by Ypy on Stack Overflow See other posts from Stack Overflow or by Ypy
Published on 2014-06-10T03:20:17Z Indexed on 2014/06/10 3:24 UTC
Read the original article Hit count: 201

I want to get the code coverage of my tests. So I set the settings, build an app with .gcno files and run it on simulator.

It can get the coverage data successfully if there is no crash issue.

But if the app crashed, I will get nothing.

So how can I get the code coverage data when the app crash?

In my thought, this is because it will not call __gcov_flush() method when app crash. I only add app does not run in background to my plist file, so __gcov_flush() is called only at the time I press Home button.

Is there any way to call __gcov_flush() before the app crash?

© Stack Overflow or respective owner

Related posts about ios

Related posts about unit-testing