diff options
author | 2017-04-10 08:23:18 +0000 | |
---|---|---|
committer | 2017-04-10 11:48:49 +0200 | |
commit | 25b17db6c159abc112e89ca1e4dce622be1f147b (patch) | |
tree | 15991d880a9511d61e50d1606f6a03e566abe928 /src/test | |
parent | 6ac454a99672547a8d9709e326e573fd51b6bf8a (diff) |
Fix the SpawnInputExpander to compute the manifest path correctly
PiperOrigin-RevId: 152663008
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java b/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java index 5b6db72c27..355e914bcc 100644 --- a/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java +++ b/src/test/java/com/google/devtools/build/lib/exec/SpawnInputExpanderTest.java @@ -191,52 +191,52 @@ public class SpawnInputExpanderTest { public void testManifestWithSingleFile() throws Exception { // See AnalysisUtils for the mapping from "foo" to "_foo/MANIFEST". scratchFile( - "/root/_foo/MANIFEST", + "/root/out/_foo/MANIFEST", "workspace/bar /dir/file", "<some digest>"); - Artifact artifact = - new Artifact(fs.getPath("/root/foo"), Root.asSourceRoot(fs.getPath("/root"))); + Root outputRoot = Root.asDerivedRoot(fs.getPath("/root"), fs.getPath("/root/out"), true); + Artifact artifact = new Artifact(fs.getPath("/root/out/foo"), outputRoot); expander.parseFilesetManifest(inputMappings, artifact, "workspace"); assertThat(inputMappings).hasSize(1); assertThat(inputMappings) - .containsEntry(PathFragment.create("foo/bar"), ActionInputHelper.fromPath("/dir/file")); + .containsEntry(PathFragment.create("out/foo/bar"), ActionInputHelper.fromPath("/dir/file")); } @Test public void testManifestWithTwoFiles() throws Exception { // See AnalysisUtils for the mapping from "foo" to "_foo/MANIFEST". scratchFile( - "/root/_foo/MANIFEST", + "/root/out/_foo/MANIFEST", "workspace/bar /dir/file", "<some digest>", "workspace/baz /dir/file", "<some digest>"); - Artifact artifact = - new Artifact(fs.getPath("/root/foo"), Root.asSourceRoot(fs.getPath("/root"))); + Root outputRoot = Root.asDerivedRoot(fs.getPath("/root"), fs.getPath("/root/out"), true); + Artifact artifact = new Artifact(fs.getPath("/root/out/foo"), outputRoot); expander.parseFilesetManifest(inputMappings, artifact, "workspace"); assertThat(inputMappings).hasSize(2); assertThat(inputMappings) - .containsEntry(PathFragment.create("foo/bar"), ActionInputHelper.fromPath("/dir/file")); + .containsEntry(PathFragment.create("out/foo/bar"), ActionInputHelper.fromPath("/dir/file")); assertThat(inputMappings) - .containsEntry(PathFragment.create("foo/baz"), ActionInputHelper.fromPath("/dir/file")); + .containsEntry(PathFragment.create("out/foo/baz"), ActionInputHelper.fromPath("/dir/file")); } @Test public void testManifestWithDirectory() throws Exception { // See AnalysisUtils for the mapping from "foo" to "_foo/MANIFEST". scratchFile( - "/root/_foo/MANIFEST", + "/root/out/_foo/MANIFEST", "workspace/bar /some", "<some digest>"); - Artifact artifact = - new Artifact(fs.getPath("/root/foo"), Root.asSourceRoot(fs.getPath("/root"))); + Root outputRoot = Root.asDerivedRoot(fs.getPath("/root"), fs.getPath("/root/out"), true); + Artifact artifact = new Artifact(fs.getPath("/root/out/foo"), outputRoot); expander.parseFilesetManifest(inputMappings, artifact, "workspace"); assertThat(inputMappings).hasSize(1); assertThat(inputMappings) .containsEntry( - PathFragment.create("foo/bar"), ActionInputHelper.fromPath("/some")); + PathFragment.create("out/foo/bar"), ActionInputHelper.fromPath("/some")); } } |