aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2018-03-07 09:53:33 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-07 09:55:05 -0800
commit3b59e02e0baec754f2dc076d644bb4f37322c739 (patch)
treeccefd5efdaf6c966ab473992f5a3f8b2f0bf574d /src/test/java/com/google/devtools/build
parent33a5db6af244e3c7bd622aa67b1d7255b56cabe4 (diff)
Added named=true to output_group.group_name
This was migrated incorrectly, as there's a semantic difference between @Param for @SkylarkSignature and for @SkylarkCallable, it would appear. RELNOTES: None. PiperOrigin-RevId: 188190409
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skylark/SkylarkDefinedAspectsTest.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkDefinedAspectsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkDefinedAspectsTest.java
index 10acb873db..998cf66654 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkDefinedAspectsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkDefinedAspectsTest.java
@@ -403,6 +403,39 @@ public class SkylarkDefinedAspectsTest extends AnalysisTestCase {
}
@Test
+ public void aspectWithOutputGroupsExplicitParamName() throws Exception {
+ scratch.file(
+ "test/aspect.bzl",
+ "def _impl(target, ctx):",
+ " f = target.output_group(group_name = '_hidden_top_level" + INTERNAL_SUFFIX + "')",
+ " return struct(output_groups = { 'my_result' : f })",
+ "",
+ "MyAspect = aspect(",
+ " implementation=_impl,",
+ ")");
+ scratch.file(
+ "test/BUILD",
+ "java_library(",
+ " name = 'xxx',",
+ " srcs = ['A.java'],",
+ ")");
+
+ AnalysisResult analysisResult =
+ update(ImmutableList.of("test/aspect.bzl%MyAspect"), "//test:xxx");
+ assertThat(getLabelsToBuild(analysisResult)).containsExactly("//test:xxx");
+ AspectValue aspectValue = analysisResult.getAspects().iterator().next();
+ OutputGroupInfo outputGroupInfo = OutputGroupInfo.get(
+ aspectValue.getConfiguredAspect());
+
+ assertThat(outputGroupInfo).isNotNull();
+ NestedSet<Artifact> names = outputGroupInfo.getOutputGroup("my_result");
+ assertThat(names).isNotEmpty();
+ NestedSet<Artifact> expectedSet = OutputGroupInfo.get(getConfiguredTarget("//test:xxx"))
+ .getOutputGroup(OutputGroupInfo.HIDDEN_TOP_LEVEL);
+ assertThat(names).containsExactlyElementsIn(expectedSet);
+ }
+
+ @Test
public void aspectWithOutputGroupsDeclaredProvider() throws Exception {
scratch.file(
"test/aspect.bzl",