Search in sources :

Example 16 with RawAttributeMapper

use of com.google.devtools.build.lib.packages.RawAttributeMapper in project bazel by bazelbuild.

the class RawAttributeMapperTest method testGetConfigurabilityKeys.

@Test
public void testGetConfigurabilityKeys() throws Exception {
    RawAttributeMapper rawMapper = RawAttributeMapper.of(setupGenRule());
    assertThat(rawMapper.getConfigurabilityKeys("srcs", BuildType.LABEL_LIST)).containsExactlyElementsIn(ImmutableSet.of(Label.parseAbsolute("//conditions:a"), Label.parseAbsolute("//conditions:b"), Label.parseAbsolute("//conditions:default")));
    assertThat(rawMapper.getConfigurabilityKeys("data", BuildType.LABEL_LIST)).isEmpty();
}
Also used : RawAttributeMapper(com.google.devtools.build.lib.packages.RawAttributeMapper) Test(org.junit.Test)

Aggregations

RawAttributeMapper (com.google.devtools.build.lib.packages.RawAttributeMapper)16 Label (com.google.devtools.build.lib.cmdline.Label)10 Rule (com.google.devtools.build.lib.packages.Rule)9 Test (org.junit.Test)7 Attribute (com.google.devtools.build.lib.packages.Attribute)4 ConfigMatchingProvider (com.google.devtools.build.lib.analysis.config.ConfigMatchingProvider)3 LinkedHashMap (java.util.LinkedHashMap)3 ConfiguredTarget (com.google.devtools.build.lib.analysis.ConfiguredTarget)2 BuildConfiguration (com.google.devtools.build.lib.analysis.config.BuildConfiguration)2 InvalidConfigurationException (com.google.devtools.build.lib.analysis.config.InvalidConfigurationException)2 FileTarget (com.google.devtools.build.lib.packages.FileTarget)2 Target (com.google.devtools.build.lib.packages.Target)2 SkyKey (com.google.devtools.build.skyframe.SkyKey)2 Nullable (javax.annotation.Nullable)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ArtifactOwner (com.google.devtools.build.lib.actions.ArtifactOwner)1 Root (com.google.devtools.build.lib.actions.Root)1 Dependency (com.google.devtools.build.lib.analysis.Dependency)1 InconsistentAspectOrderException (com.google.devtools.build.lib.analysis.DependencyResolver.InconsistentAspectOrderException)1