aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-03-27 16:19:21 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-27 16:21:32 -0700
commita579d65c52b3348c5a336fca6e44ab1e69ed7170 (patch)
treee8a241678970d70c06b3cfbaa61868ccfcfb9349 /src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java
parent7292497d51ab20fdff74252de58a14fddb5276ee (diff)
Replace nearly all test uses of ConfiguredTarget#getConfiguration with utility method getConfiguration(ConfiguredTarget). Done using IntelliJ structural replace, with
$val$.getConfiguration() -> getConfiguration($val$) and Expression type: TransitiveInfoCollection, applying constraint within type hierarchy. Had to clean up a few compile errors. PiperOrigin-RevId: 190692493
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java
index 28a922668a..7105d917ef 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsWithTrimmedConfigurationsTest.java
@@ -179,7 +179,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
")",
"rule_class_transition(name='rule_class')");
List<ConfiguredTarget> deps = getConfiguredDeps("//a:attribute", "without_transition");
- BuildConfiguration ruleclass = Iterables.getOnlyElement(deps).getConfiguration();
+ BuildConfiguration ruleclass = getConfiguration(Iterables.getOnlyElement(deps));
assertThat(ruleclass.getCpu()).isEqualTo("SET BY PATCH");
}
@@ -194,7 +194,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
")",
"rule_class_transition(name='rule_class')");
List<ConfiguredTarget> deps = getConfiguredDeps("//a:attribute", "with_host_cpu_transition");
- BuildConfiguration ruleclass = Iterables.getOnlyElement(deps).getConfiguration();
+ BuildConfiguration ruleclass = getConfiguration(Iterables.getOnlyElement(deps));
assertThat(ruleclass.getCpu()).isEqualTo("SET BY PATCH");
assertThat(ruleclass.getHostCpu()).isEqualTo("SET BY SPLIT");
}
@@ -210,7 +210,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
")",
"rule_class_transition(name='rule_class')");
List<ConfiguredTarget> deps = getConfiguredDeps("//a:attribute", "with_cpu_transition");
- BuildConfiguration ruleclass = Iterables.getOnlyElement(deps).getConfiguration();
+ BuildConfiguration ruleclass = getConfiguration(Iterables.getOnlyElement(deps));
assertThat(ruleclass.getCpu()).isEqualTo("SET BY PATCH");
}
@@ -226,7 +226,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
")",
"rule_class_transition(name='rule_class')");
List<ConfiguredTarget> deps = getConfiguredDeps("//a:empty", "with_empty_transition");
- BuildConfiguration ruleclass = Iterables.getOnlyElement(deps).getConfiguration();
+ BuildConfiguration ruleclass = getConfiguration(Iterables.getOnlyElement(deps));
assertThat(ruleclass.getCpu()).isEqualTo("SET BY PATCH");
}
@@ -240,7 +240,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
")");
ConfiguredTarget target =
Iterables.getOnlyElement(update("//a:rule_class").getTargetsToBuild());
- assertThat(target.getConfiguration().getCpu()).isEqualTo("SET BY PATCH");
+ assertThat(getConfiguration(target).getCpu()).isEqualTo("SET BY PATCH");
}
@Test
@@ -255,7 +255,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
"simple(name='sim')");
ConfiguredTarget target =
Iterables.getOnlyElement(update("//a:sim").getTargetsToBuild());
- assertThat(target.getConfiguration().getCpu()).isNotEqualTo("SET BY PATCH");
+ assertThat(getConfiguration(target).getCpu()).isNotEqualTo("SET BY PATCH");
}
@Test
@@ -275,7 +275,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
" sets_test_filter_to='funkiest',",
")");
List<ConfiguredTarget> deps = getConfiguredDeps("//a:top", "without_transition");
- BuildConfiguration config = Iterables.getOnlyElement(deps).getConfiguration();
+ BuildConfiguration config = getConfiguration(Iterables.getOnlyElement(deps));
assertThat(config.getFragment(TestConfiguration.class).getTestFilter())
.isEqualTo("SET BY PATCH FACTORY: funkiest");
}
@@ -296,7 +296,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
" sets_test_filter_to='',",
")");
List<ConfiguredTarget> deps = getConfiguredDeps("//a:top", "without_transition");
- BuildConfiguration config = Iterables.getOnlyElement(deps).getConfiguration();
+ BuildConfiguration config = getConfiguration(Iterables.getOnlyElement(deps));
assertThat(config.getFragment(TestConfiguration.class).getTestFilter())
.isEqualTo("SET ON COMMAND LINE: original and best");
}
@@ -313,7 +313,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
" sets_test_filter_to='Maximum Dance',",
")");
ConfiguredTarget target = Iterables.getOnlyElement(update("//a:factory").getTargetsToBuild());
- assertThat(target.getConfiguration().getFragment(TestConfiguration.class).getTestFilter())
+ assertThat(getConfiguration(target).getFragment(TestConfiguration.class).getTestFilter())
.isEqualTo("SET BY PATCH FACTORY: Maximum Dance");
}
@@ -333,7 +333,7 @@ public class ConfigurationsForTargetsWithTrimmedConfigurationsTest
reporter,
Label.parseAbsoluteUnchecked("@//a:factory"),
getTargetConfiguration());
- assertThat(target.getConfiguration().getFragment(TestConfiguration.class).getTestFilter())
+ assertThat(getConfiguration(target).getFragment(TestConfiguration.class).getTestFilter())
.isEqualTo("SET ON COMMAND LINE: original and best");
}