Skip to content

Commit

Permalink
Internal functionality
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 700275113
  • Loading branch information
A Googler authored and Blaze Rules Copybara committed Nov 26, 2024
1 parent 7b562c4 commit 70f9a3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/unittest.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def _make_analysis_test(
fragments = [],
config_settings = {},
extra_target_under_test_aspects = [],
target_under_test_for_dependency_resolution = False,
doc = ""):
"""Creates an analysis test rule from its implementation function.
Expand Down Expand Up @@ -267,6 +268,9 @@ def _make_analysis_test(
flags in a single build
extra_target_under_test_aspects: An optional list of aspects to apply to the target_under_test
in addition to those set up by default for the test harness itself.
target_under_test_for_dependency_resolution: If true, the target_under_test will be used for
dependency resolution. See
https://bazel.build/rules/lib/toplevel/attr#label.for_dependency_resolution for more info.
doc: A description of the rule that can be extracted by documentation generating tools.
Returns:
Expand All @@ -287,6 +291,9 @@ def _make_analysis_test(
)
target_attr_kwargs["cfg"] = test_transition

if target_under_test_for_dependency_resolution:
target_attr_kwargs["for_dependency_resolution"] = True

attrs["target_under_test"] = attr.label(
aspects = [_action_retrieving_aspect] + extra_target_under_test_aspects,
mandatory = True,
Expand Down

0 comments on commit 70f9a3c

Please sign in to comment.