How to exclude third party pods libraries from XCode UI test coverage report
Asked Answered
W

1

14

I am testing an IOS app with Xcode inbuilt UI test cases which is working fine , i have enabled code coverage which reports third party cocoa pods library in code coverage report , I want to know how to exclude third party libraries from code coverage report.

Weatherwise answered 1/6, 2016 at 13:14 Comment(1)
This might help: https://mcmap.net/q/507885/-code-coverage-with-cocoapods-library-ios-unit-testOrchestrion
D
0

You should disable the Code Coverage for the Targets that you don't want to be covered. If you want all of your pods to not be included in the code coverage you can add on your podfile

#   Disable Code Coverage for objc Pod projects
post_install do |installer_representation|
   installer_representation.pods_project.targets.each do |target|
       target.build_configurations.each do |config|
            config.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'NO'
       end
   end
end

Run 'pod install' to apply the changes.

NOTE: This only works for objc pods. I haven't found a solution for Swift pods yet.

Dreamworld answered 2/11, 2017 at 10:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.