Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't Xcode showing test coverage?

Using Xcode 8.2.1

A suite of Swift XCT unit tests isn't highlighting code coverage (with green/red highlighting and numbering) on the corresponding swift file when run.

  • I have ticked code coverage : Gather coverage data in the test scheme.
  • I have tried deleting ~/Library/Developer/Xcode/DerivedData and
    ~/Library/com.apple.dt.Xcode, in finder.
  • I have tried quitting simulator and running again.
  • I have tried running all tests with cmd ⌘ + U, the diamond in the test class, and individual tests.
  • All tests are passing

I know the report navigator can show coverage but it is in a detached way.

like image 854
jMan Avatar asked May 04 '17 16:05

jMan


1 Answers

Works fine on my machine:

enter image description here

enter image description here

Don't forget to choose Editor > Show Code Coverage (you didn't mention that in your little checklist).

like image 101
matt Avatar answered Sep 28 '22 09:09

matt