use of com.google.devtools.build.lib.analysis.util.TestAspects.AspectRequiringRule in project bazel by bazelbuild.
the class AspectTest method testAspectAppliedToChainedAliases.
@Test
public void testAspectAppliedToChainedAliases() throws Exception {
setRulesAvailableInTests(new TestAspects.BaseRule(), new AspectRequiringRule());
pkg("a", "aspect(name='a', foo=[':b'])", "alias(name='b', actual=':c')", "alias(name='c', actual=':d')", "alias(name='d', actual=':e')", "base(name='e')");
ConfiguredTarget a = getConfiguredTarget("//a:a");
assertThat(a.getProvider(RuleInfo.class).getData()).containsExactly("aspect //a:e", "rule //a:a");
}
use of com.google.devtools.build.lib.analysis.util.TestAspects.AspectRequiringRule in project bazel by bazelbuild.
the class AspectTest method providersOfAspectAreMergedIntoDependency.
@Test
public void providersOfAspectAreMergedIntoDependency() throws Exception {
setRulesAvailableInTests(new TestAspects.BaseRule(), new AspectRequiringRule());
pkg("a", "aspect(name='a', foo=[':b'])", "aspect(name='b', foo=[])");
ConfiguredTarget a = getConfiguredTarget("//a:a");
assertThat(a.getProvider(RuleInfo.class).getData()).containsExactly("aspect //a:b", "rule //a:a");
}
use of com.google.devtools.build.lib.analysis.util.TestAspects.AspectRequiringRule in project bazel by bazelbuild.
the class DependencyResolverTest method hasAspectsRequiredByRule.
@Test
public void hasAspectsRequiredByRule() throws Exception {
setRulesAvailableInTests(new AspectRequiringRule(), new TestAspects.BaseRule());
pkg("a", "aspect(name='a', foo=[':b'])", "aspect(name='b', foo=[])");
OrderedSetMultimap<Attribute, Dependency> map = dependentNodeMap("//a:a", null);
assertDep(map, "foo", "//a:b", new AspectDescriptor(TestAspects.SIMPLE_ASPECT));
}
use of com.google.devtools.build.lib.analysis.util.TestAspects.AspectRequiringRule in project bazel by bazelbuild.
the class AspectTest method testAspectAppliedToAliasWithSelect.
@Test
public void testAspectAppliedToAliasWithSelect() throws Exception {
setRulesAvailableInTests(new TestAspects.BaseRule(), new AspectRequiringRule());
pkg("a", "aspect(name='a', foo=[':b'])", "alias(name='b', actual=select({'//conditions:default': ':c'}))", "base(name='c')");
ConfiguredTarget a = getConfiguredTarget("//a:a");
assertThat(a.getProvider(RuleInfo.class).getData()).containsExactly("aspect //a:c", "rule //a:a");
}
use of com.google.devtools.build.lib.analysis.util.TestAspects.AspectRequiringRule in project bazel by bazelbuild.
the class AspectTest method testAspectAppliedToChainedAliasesAndSelect.
@Test
public void testAspectAppliedToChainedAliasesAndSelect() throws Exception {
setRulesAvailableInTests(new TestAspects.BaseRule(), new AspectRequiringRule());
pkg("a", "aspect(name='a', foo=[':b'])", "alias(name='b', actual=select({'//conditions:default': ':c'}))", "alias(name='c', actual=select({'//conditions:default': ':d'}))", "base(name='d')");
ConfiguredTarget a = getConfiguredTarget("//a:a");
assertThat(a.getProvider(RuleInfo.class).getData()).containsExactly("aspect //a:d", "rule //a:a");
}
Aggregations