aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java
diff options
context:
space:
mode:
authorGravatar Greg Estren <gregce@google.com>2016-08-10 20:50:09 +0000
committerGravatar Yue Gan <yueg@google.com>2016-08-11 09:15:37 +0000
commit247ac16337769e4492f4ac0a0a4fd786c92eed24 (patch)
treeaa4193974dfd7a2441249d67e3e67a44d1ec8183 /src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java
parentf3ec5975023362a05a8d01a7e7e22a4d9bcad60a (diff)
Dynamic config test improvements:
- Adds a helper routine to get all configured targets with a given label - Enhances latebound split test to check that deps actually take expected configurations -- MOS_MIGRATED_REVID=129906477
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java b/src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java
index 7c7c4f9a6c..34218e67c8 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/util/SkyframeExecutorTestUtils.java
@@ -13,7 +13,9 @@
// limitations under the License.
package com.google.devtools.build.lib.skyframe.util;
+import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
@@ -105,6 +107,23 @@ public class SkyframeExecutorTestUtils {
}
/**
+ * Returns all configured targets currently in the graph with the given label.
+ *
+ * <p>Unlike {@link #getExistingConfiguredTarget(SkyframeExecutor, Label, BuildConfiguration)},
+ * this doesn't make the caller request a specific configuration.
+ */
+ public static Iterable<ConfiguredTarget> getExistingConfiguredTargets(
+ SkyframeExecutor skyframeExecutor, final Label label) {
+ return Iterables.filter(getAllExistingConfiguredTargets(skyframeExecutor),
+ new Predicate<ConfiguredTarget>() {
+ @Override
+ public boolean apply(ConfiguredTarget input) {
+ return input.getTarget().getLabel().equals(label);
+ }
+ });
+ }
+
+ /**
* Returns all configured targets currently in the graph.
*/
public static Iterable<ConfiguredTarget> getAllExistingConfiguredTargets(