2
votes

enter image description hereI'm writing a framework using Swift3 in Xcode 8 (File > New > Project > Cocoa Touch Framework). I've edited the test scheme to gather coverage data but when I view the coverage tab in the report navigator all coverage bars are empty! When I check the 'Show Test Bundles' option I see the tests but they are not in the framework!

Has anyone else had this issue and is there a fix?

2
Wow! Thanks to your question now I know I can see something using Show Test Bundles. I thought it was all zero!GabrielOshiro
I'm experiencing a similar issue with my App bundle. App bundle coverage shows 0%, where as test bundle shows 100%. Similar to original poster's posted image. Can't figure out why such a report.Surpher

2 Answers

3
votes

Turns out that the app bundle code coverage is 0% until it is actually used in the implementation. If you're doing strict TDD and checking the code coverage before even using the class/struct/model/,whatever you're working on, it won't show up in the report.

Kinda makes sense. It's Xcode's way of saying:
"Hey buddy, you've got this code here but it isn't actually called in your app bundle."

0
votes

This happens sometimes and seems to be an issue with Xcode.Do the following

  1. Quit Xcode and relaunch again.
  2. Build the framework for same device or simulator.(Here build the Lister.frameowrk)
  3. Run the test scripts and check the code coverage again.

This worked for me.