diff options
author | 2017-11-29 14:01:21 -0800 | |
---|---|---|
committer | 2017-11-29 14:03:30 -0800 | |
commit | 3d1a194ff9e76f25f1a7242ff2d021523ba8e4a0 (patch) | |
tree | 9fec583a59b8ee6ee0f4fac513d5471956dfe1d3 /src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java | |
parent | 8f8b8859fc7d85feee97481443fb11c0b7ae03ce (diff) |
Add ActionKeyContext to Action#getKey.
This key context can be used by actions to share partial key computations, for instance when computing MD5s for nested sets.
RELNOTES: None
PiperOrigin-RevId: 177359607
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java b/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java index 296703eef6..7c92958d40 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java +++ b/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java @@ -41,6 +41,7 @@ public class ArtifactTest { private Scratch scratch; private Path execDir; private Root rootDir; + private final ActionKeyContext actionKeyContext = new ActionKeyContext(); @Before public final void setRootDir() throws Exception { @@ -169,7 +170,7 @@ public class ArtifactTest { @Test public void testAddExecPaths() throws Exception { List<String> paths = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); Artifact.addExecPaths(getFooBarArtifacts(actionGraph, false), paths); assertThat(paths).containsExactly("bar1.h", "bar2.h"); } @@ -177,7 +178,7 @@ public class ArtifactTest { @Test public void testAddExpandedExecPathStrings() throws Exception { List<String> paths = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); Artifact.addExpandedExecPathStrings(getFooBarArtifacts(actionGraph, true), paths, ActionInputHelper.actionGraphArtifactExpander(actionGraph)); assertThat(paths).containsExactly("bar1.h", "bar1.h", "bar2.h", "bar3.h"); @@ -186,7 +187,7 @@ public class ArtifactTest { @Test public void testAddExpandedExecPaths() throws Exception { List<PathFragment> paths = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); Artifact.addExpandedExecPaths(getFooBarArtifacts(actionGraph, true), paths, ActionInputHelper.actionGraphArtifactExpander(actionGraph)); assertThat(paths).containsExactly( @@ -199,7 +200,7 @@ public class ArtifactTest { @Test public void testAddExpandedArtifacts() throws Exception { List<Artifact> expanded = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); List<Artifact> original = getFooBarArtifacts(actionGraph, true); Artifact.addExpandedArtifacts(original, expanded, ActionInputHelper.actionGraphArtifactExpander(actionGraph)); @@ -219,7 +220,7 @@ public class ArtifactTest { @Test public void testAddExecPathsNewActionGraph() throws Exception { List<String> paths = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); Artifact.addExecPaths(getFooBarArtifacts(actionGraph, false), paths); assertThat(paths).containsExactly("bar1.h", "bar2.h"); } @@ -227,7 +228,7 @@ public class ArtifactTest { @Test public void testAddExpandedExecPathStringsNewActionGraph() throws Exception { List<String> paths = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); Artifact.addExpandedExecPathStrings(getFooBarArtifacts(actionGraph, true), paths, ActionInputHelper.actionGraphArtifactExpander(actionGraph)); assertThat(paths).containsExactly("bar1.h", "bar1.h", "bar2.h", "bar3.h"); @@ -236,7 +237,7 @@ public class ArtifactTest { @Test public void testAddExpandedExecPathsNewActionGraph() throws Exception { List<PathFragment> paths = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); Artifact.addExpandedExecPaths(getFooBarArtifacts(actionGraph, true), paths, ActionInputHelper.actionGraphArtifactExpander(actionGraph)); assertThat(paths).containsExactly( @@ -250,7 +251,7 @@ public class ArtifactTest { @Test public void testAddExpandedArtifactsNewActionGraph() throws Exception { List<Artifact> expanded = new ArrayList<>(); - MutableActionGraph actionGraph = new MapBasedActionGraph(); + MutableActionGraph actionGraph = new MapBasedActionGraph(actionKeyContext); List<Artifact> original = getFooBarArtifacts(actionGraph, true); Artifact.addExpandedArtifacts(original, expanded, ActionInputHelper.actionGraphArtifactExpander(actionGraph)); |