CodeCoverage (for UI tests) shown only for code from Application bundle, but missed for code from shared Framework.
Originator: | volodymyr.gorlov | ||
Number: | rdar://24006783 | Date Originated: | 24-Dec-2015 |
Status: | Open (DUPLICATE OF 23913271) | Resolved: | |
Product: | Developer Tools | Product Version: | |
Classification: | Reproducible: | 100% |
Summary: iOS application [Xcode target UITestingDemo] (see https://github.com/vgorloff/Radar24006783) contains UI Tests [UITestingDemoUITests] and Logic Tests [UITestingDemoTests]. iOS application also uses Shared Framework [UITestingDemoKit] with reusable code. After running UI Tests and Logic Tests within target, the CodeCoverage report contain the following statistics: - Code usage from Application Bundle (produced by UI Tests) - Code usage from Shared Framework (produced by Logic Tests) But the CodeCoverage report does not contains the following statistics: - Code usage from Shared Framework (produced by UI Tests) Steps to Reproduce: Open attached project in Xcode. Select iPhone 6s as destination. Select shared build schema "UITestingDemo" and run tests (press cmd+U). Expected Results: CodeCoverage report should show statistics about MyView class usage. Actual Results: CodeCoverage report show that MyView class usage is zero (0) which is not truth because this class and it's methods used during UI Tests. Version: Xcode 7.2 (7C68), iOS 9.2 Simulator (13C75) Notes: One more issue: Disabling Logic Tests [Xcode target UITestingDemoTests] from build schema cause cause CodeCoverage report show zero statistics for all classes (zero code usage). Configuration: MacBook Pro (Retina, 15-inch, Late 2013) Mac OS X El Capitan 10.11.2 (15C50)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Xcode Version 9.3 beta (9Q98q)
Xcode Version 9.3 beta (9Q98q) seems resolves issue as long as
Debug executable
not enables:Test -> Info tab -> Debugger
make sure that checkboxDebug executable
is unchecked.Example project: https://github.com/vgorloff/Radar24006783
Any update on this issue?
Hi, Even I want the embedded framework to show the code coverage. Is there a way? Any updates on this issue?
Found workaround.
As long as project meet following criteria the workaround will work:
Workaround:
As result:
See full example here: https://github.com/vgorloff/Radar24006783