Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Code Coverage Statistics IOS

I am trying to get the code coverage statistics from the .gcda file. I know similar questions are there but I did not get what I want then.

Till now, I got the .gcda files after some googling on how to do it. Got Coverstory to read them. Now when I open one .gcda file it will give me the code coverage of that particular file.

Can any one tell me on how to get the statistics of the entire project in a form of matrix? are there any tools available to read those gcda file and auto generate the report. Are there any better way to get the code coverage?

Any sort of help would be really helpful

like image 563
Prajwal Avatar asked Feb 28 '13 15:02

Prajwal


People also ask

How do I get code coverage results?

Code coverage option is available under the Test menu when you run test methods using Test Explorer. The results table shows the percentage of the code executed in each assembly, class, and procedure.

How do I use IOS code coverage?

To enable code coverage, click the scheme editor in the toolbar. Select the CodecovDemo scheme and choose Edit Scheme. Select the Test action on the left. Check the Code Coverage box to gather coverage data.

How do I generate code coverage report in Xcode?

Reports navigator(View menu > Navigators > Reports or ⌘ - command + 9 ). After you open it, under the latest Test report, you should find a Coverage report, click on that, and it will contain the coverage information of that test run. You can find code coverage report under the Reports navigator.

What is code coverage in unit testing IOS?

Key to unit testing is code coverage, which indicates what percent of the tested code was executed when the corresponding unit tests were run. Generally, we want to have a high percentage of code coverage. Xcode 7 introduced a code coverage feature which allows us to measure and visualize code coverage.


2 Answers

I find this to be very helpful. Xcode code coverage

like image 89
nhisyam Avatar answered Oct 04 '22 02:10

nhisyam


Try the Alcove gem:

https://github.com/ioveracker/alcove

Full disclosure: I'm the author of this gem. Please give it a try and let me know what you think.

like image 37
Isaac Overacker Avatar answered Oct 04 '22 00:10

Isaac Overacker