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

Only link in the Bazel test observer when discovering tests. #1273

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions swift/swift_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,14 @@ def _swift_test_impl(ctx):
srcs = ctx.files.srcs
owner_symbol_graph_dir = None

# Inject the test observer that prints the xUnit-style output for Bazel.
all_deps = ctx.attr.deps + [ctx.attr._test_observer]
all_deps = list(ctx.attr.deps)

# In test discovery mode (whether manual or by the Obj-C runtime), inject
# the test observer that prints the xUnit-style output for Bazel. Otherwise
# don't link this, because we don't want it to pull in link time
# dependencies on XCTest, which the test binary may not be using.
if discover_tests:
all_deps.append(ctx.attr._test_observer)

module_name = ctx.attr.module_name
if not module_name:
Expand Down