How to flush coverage data when my test cause app crash - For ios app
- by Ypy
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?