Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bazel coverage command with dynamic apple_framework targets #647

Open
mccorkill1 opened this issue Jan 24, 2023 · 1 comment

Comments

@mccorkill1
Copy link
Contributor

When running bazel coverage against an ios_unit_test target that depends on an apple_framework target with link_dynamic = 1, the coverage report generated does not include the files from the apple_framework target. If link_dynamic = 0, those files are included in the coverage report.

See https://github.com/mccorkill1/CoverageExample for an example with instructions in the readme to recreate the problem.

@gabijarciskeviciute
Copy link

The solution to this is to include the apple_framework target dependency to the frameworks attribute of the ios_unit_test. rules_apple decides which binaries to pass as arguments to xcrun llvm. Without adding it to the frameworks attribute, only the test binary is passed as an argument, so it works for statically linked framework but not dynamically linked. Adding the framework to the frameworks attribute of the ios_unit_test gets the framework added as a binary argument to xcrun llvm in addition to the unit tests which results in coverage on the framework when linked dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants