UI Testing - Code Coverage for custom framework is not shown in Xcode

1) Create a Cocoa touch framework project and include some source code.

2) Create a Single view application project, make sure you include UI Tests.

3) Include the framework code in the application.

4) Use the framework code in the application.

5) Go to UI Test swift file, Record or write UI test, Make sure framework code is called.

6) enable code coverage.

7) run the UI test.

8) Observe the code coverage. None of methods in the framework are being covered even though some of code in the framework is executed.


So my question is how do I see the code coverage for the framework code?


I have recorded the screen and uploaded the movie in the below link. Please do check out.


https://www.dropbox.com/s/nh3lwibkmgz2g4v/CodeCoverage.mov?dl=0

Replies

I've got the same question. I've created radar 28571841 with an example project. So far nobody seems to have picked it up at Apple yet - would be great if you could file a duplicate radar to get it some more attention!

I filed a radar on this last year.


Was hoping Xcode 9.3, which appears to have updates for Code Coverage, would resolve this issue. Sadly, at least in my limited testing, it still appears to not work for a framework.


😢