5

The Code Coverage report generated by XCode 9 seems to be off on some files in my project. It shows 0% in one of the class file enter image description here While when I check the codes it actually covered by the test enter image description here

It looks like that the coverage report is actually in-sync with the tests???

Environment: Xcode 9.2 Swift 4

Community
  • 1
  • 1
WilsonL
  • 167
  • 1
  • 2
  • 10

1 Answers1

3

I believe you'll find the answer here Code coverage result is not accurate to real coverage in Xcode 7

Briefly it says to use

@testable import <yourapp>

In each test file and don't add your app .swift files to the test targets.

Works for me.

Gary M
  • 428
  • 5
  • 13