diff options
author | Lukacs Berki <lberki@google.com> | 2016-04-12 13:48:24 +0000 |
---|---|---|
committer | Lukacs Berki <lberki@google.com> | 2016-04-13 08:08:40 +0000 |
commit | 75250e614fbfc9d1597ca8d7c7324880690c1e27 (patch) | |
tree | cbb79f85a4cc2a54e222df12ac0607546a76dc0d | |
parent | 8b56c8cd8aff04dd76a198825ad7ab7b44350438 (diff) |
Add a disabled test case that tickles a bug with the interaction of aspects and bind().
--
MOS_MIGRATED_REVID=119633865
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java index f5ac38c30b..ea9e4bb99b 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java @@ -40,6 +40,7 @@ import com.google.devtools.build.lib.packages.AspectDefinition; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.RuleClass; import com.google.devtools.build.lib.testutil.TestRuleClassProvider; +import com.google.devtools.build.lib.vfs.ModifiedFileSet; import org.junit.Test; import org.junit.runner.RunWith; @@ -95,6 +96,29 @@ public class AspectTest extends AnalysisTestCase { assertThat(a.getProvider(RuleInfo.class).getData()).containsExactly("rule //a:a"); } + // Disabled because this is a bug. Also note that if we fix this, query also needs to be fixed + // so that it reports implicit dependencies reached through these aspects. + //@Test + public void aspectCreationWorksThroughBind() throws Exception { + setRules(new TestAspects.BaseRule(), new TestAspects.HonestRule(), + new TestAspects.AspectRequiringProviderRule()); + + pkg("a", + "aspect_requiring_provider(name='a', foo=['//external:b'])", + "honest(name='b', foo=[])"); + + scratch.overwriteFile("WORKSPACE", + "bind(name='b', actual='//a:b')"); + + skyframeExecutor.invalidateFilesUnderPathForTesting(reporter, + ModifiedFileSet.EVERYTHING_MODIFIED, rootDirectory); + + ConfiguredTarget a = getConfiguredTarget("//a:a"); + assertThat(a.getProvider(RuleInfo.class).getData()) + .containsExactly("rule //a:a", "aspect //a:b"); + } + + @Test public void aspectCreatedIfAdvertisedProviderIsPresent() throws Exception { setRules(new TestAspects.BaseRule(), new TestAspects.HonestRule(), |