Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into add_subpackages
Browse files Browse the repository at this point in the history
  • Loading branch information
kkress committed Feb 11, 2022
2 parents 2830756 + cdd0afd commit 3eed637
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/unittest_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ unittest_toolchain(<a href="#unittest_toolchain-name">name</a>, <a href="#unitte

<pre>
analysistest.make(<a href="#analysistest.make-impl">impl</a>, <a href="#analysistest.make-expect_failure">expect_failure</a>, <a href="#analysistest.make-attrs">attrs</a>, <a href="#analysistest.make-fragments">fragments</a>, <a href="#analysistest.make-config_settings">config_settings</a>,
<a href="#analysistest.make-extra_target_under_test_aspects">extra_target_under_test_aspects</a>)
<a href="#analysistest.make-extra_target_under_test_aspects">extra_target_under_test_aspects</a>, <a href="#analysistest.make-doc">doc</a>)
</pre>

Creates an analysis test rule from its implementation function.
Expand Down Expand Up @@ -78,6 +78,7 @@ Recall that names of test rules must end in `_test`.
| <a id="analysistest.make-fragments"></a>fragments | An optional list of fragment names that can be used to give rules access to language-specific parts of configuration. | <code>[]</code> |
| <a id="analysistest.make-config_settings"></a>config_settings | A dictionary of configuration settings to change for the target under test and its dependencies. This may be used to essentially change 'build flags' for the target under test, and may thus be utilized to test multiple targets with different flags in a single build | <code>{}</code> |
| <a id="analysistest.make-extra_target_under_test_aspects"></a>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. | <code>[]</code> |
| <a id="analysistest.make-doc"></a>doc | A description of the rule that can be extracted by documentation generating tools. | <code>""</code> |

**RETURNS**

Expand Down
5 changes: 4 additions & 1 deletion lib/unittest.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def _make_analysis_test(
attrs = {},
fragments = [],
config_settings = {},
extra_target_under_test_aspects = []):
extra_target_under_test_aspects = [],
doc = ""):
"""Creates an analysis test rule from its implementation function.
An analysis test verifies the behavior of a "real" rule target by examining
Expand Down Expand Up @@ -250,6 +251,7 @@ 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.
doc: A description of the rule that can be extracted by documentation generating tools.
Returns:
A rule definition that should be stored in a global whose name ends in
Expand Down Expand Up @@ -277,6 +279,7 @@ def _make_analysis_test(

return rule(
impl,
doc = doc,
attrs = attrs,
fragments = fragments,
test = True,
Expand Down

0 comments on commit 3eed637

Please sign in to comment.