SlatherOrg / slather

Generate test coverage reports for Xcode projects & hook it into CI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different coverage percentage from XCode report

domenicontt opened this issue · comments

Hi Team,
The report generated by slather provides coverage percentages that are far different from those provided by XCode. For many swift classes that have 100% coverage with XCode, slather reports zero coverage.
Any suggestions to solve this problem?
Thanks!

Need more details. Is Slather printing any warnings or errors when you run it?

Hi, sorry for the lack of details in the previous comment. During slather running I don't have any errors or warnings. My project uses XCode 15.2 and Swift 5.
Thanks!

Still not enough details for me to investigate anything. Can you copy the log from XCode that does code coverage and also the log from your slather run?

FWIW I've also seen inconsistencies between what Slather is reporting vs what Xcode is reporting. I was seeing partial coverage on a few files not being reported. Played around with my slather configuration for a little bit, but didn't have any luck. To circumvent the issue, I moved our CI coverage reporting over to Xcov from Slather, and the reporting is now 1-1 with Xcode. Here's a screen shot of an example of what wasn't covered (just the initializer in this file, everything else was covered). Didn't see any warnings or errors in the console when generating Slather reports. We're also on Xcode 15.2 now, but we've been seeing the problem for a few months and also used Xcode 15.0.

image