Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display Xcode code coverage when is not displaing?

I have been trying to get the code coverage for my project using Xcode 9. All test cases run successfully but did not generate the code coverage report under the Code coverage tab.

I tried the following things:

  1. Enable the Gather code coverage in the scheme.

  2. Enable Code Coverage Support for my target.

  3. Enable the Showcase bundle option.

    Is there an extra setting require to check the code coverage report ? or should I miss something? Thanks in advance.

like image 707
yo2bh Avatar asked Nov 07 '17 11:11

yo2bh


People also ask

How do I show code coverage in Xcode?

Enabling Code Coverage in Xcode Code coverage is enabled in the scheme editor. Click the Covered scheme and choose Edit Scheme.... Select Test on the left and check the checkbox Gather coverage data. That is it.

How do I display code coverage?

On the Test menu, select Analyze Code Coverage for All Tests. You can also run code coverage from the Test Explorer tool window. Show Code Coverage Coloring in the Code Coverage Results window. By default, code that is covered by tests is highlighted in light blue.

How do I configure code coverage?

Configure coveragePress Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Coverage. Define how the collected coverage data will be processed: Show options before applying coverage to the editor: show the Code Coverage dialog every time you run a new run configuration with code coverage.

How do I check my code coverage karma?

Code coverage enforcementlink To enable this, open the Karma test platform configuration file, karma. conf. js , and add the check property in the coverageReporter: key. The check property causes the tool to enforce a minimum of 80% code coverage when the unit tests are run in the project.


3 Answers

Issue Resolve in Version 9.3, to get the code coverage Target -> Test -> Options -> CodeCoverage See image:

image


like image 88
krishnendra Avatar answered Oct 17 '22 22:10

krishnendra


If you want to see the code coverage in the right side of the editor, make sure you have Show Code Coverage selected in the Editor drop down menu.

Show Code Coverage

like image 27
BergerBytes Avatar answered Oct 17 '22 23:10

BergerBytes


I'm pretty sure they just moved the code coverage to a new location. I'm seeing it now as part of the report navigator (see screenshot below).

To get there, first turn on code coverage support (edit scheme -> test -> options -> check code coverage box) then look on the left hand side of xcode at the navigator. At the top you will see a bunch of icons. Click on the last one on the right (it looks like a message bubble).

Within that tab, you will see all the tests you ran. Within each test is a "coverage" item. Click on one of those to get the coverage report for that specific test.

xcode window

like image 12
Brian Sachetta Avatar answered Oct 18 '22 00:10

Brian Sachetta