I am setting up code coverage for an iOS application. I am using XCode 5.0.2 and gcovr 3.1 to test and perform code coverage for iOS 7 devices. I initially had issues with .gcda
file generation but I followed this blog and resolved the issue.
I have set ‘Generate test coverage files’ to ‘Yes’, ‘Instrument Program flow’ to ‘Yes’ for the Debug module only. I have also set -fprofile-arcs -ftest-coverage
for Debug module in ‘Other C Flags’. I have added __gcov_flush()
in my app code when application terminates.
Now .gcda files are generating without issues.
I then copy that to my workspace in my Home directory. From the workspace, I try to run code coverage for the application. I execute the gcovr
command from the command line, passing –object-directory
and gcov
command runs for the 252 gdca files I have. In the end I get this output:
Gathered coverage data for 0 files
Please help me in solving the issue. I have spent a lot of time browsing for similar issues but none of the solutions is working out.