aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/cmdline
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2017-02-16 17:00:53 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2017-02-16 17:02:42 +0000
commit4b73e972d909bcd533f2f9940f95a00b9b73bdde (patch)
tree9144d26934aef8e16036d80d249f416bc585bbe4 /src/test/java/com/google/devtools/build/lib/cmdline
parentb222872e8d61cbd590bdaeb3cbb1764df70e4270 (diff)
Roll forward execroot change
RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Custom crosstools that hardcode external/<repo> paths will have to be updated. Issue #1262. -- PiperOrigin-RevId: 147726370 MOS_MIGRATED_REVID=147726370
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/cmdline')
-rw-r--r--src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/cmdline/PackageIdentifierTest.java13
-rw-r--r--src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java8
3 files changed, 11 insertions, 12 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java b/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java
index 3766a76755..9fe683ce01 100644
--- a/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java
+++ b/src/test/java/com/google/devtools/build/lib/cmdline/LabelTest.java
@@ -448,6 +448,6 @@ public class LabelTest {
Label label = Label.parseAbsolute("//bar/baz");
assertThat(label.getWorkspaceRoot()).isEmpty();
label = Label.parseAbsolute("@repo//bar/baz");
- assertThat(label.getWorkspaceRoot()).isEqualTo("external/repo");
+ assertThat(label.getWorkspaceRoot()).isEqualTo("../repo");
}
}
diff --git a/src/test/java/com/google/devtools/build/lib/cmdline/PackageIdentifierTest.java b/src/test/java/com/google/devtools/build/lib/cmdline/PackageIdentifierTest.java
index a19ef4b7a3..42642b8851 100644
--- a/src/test/java/com/google/devtools/build/lib/cmdline/PackageIdentifierTest.java
+++ b/src/test/java/com/google/devtools/build/lib/cmdline/PackageIdentifierTest.java
@@ -19,12 +19,10 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import com.google.devtools.build.lib.vfs.PathFragment;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -39,8 +37,7 @@ public class PackageIdentifierTest {
PackageIdentifier fooA = PackageIdentifier.parse("@foo//a");
assertThat(fooA.getRepository().strippedName()).isEqualTo("foo");
assertThat(fooA.getPackageFragment().getPathString()).isEqualTo("a");
- assertThat(fooA.getRepository().getSourceRoot()).isEqualTo(
- new PathFragment("external/foo"));
+ assertThat(fooA.getRepository().getSourceRoot()).isEqualTo(new PathFragment("external/foo"));
PackageIdentifier absoluteA = PackageIdentifier.parse("//a");
assertThat(absoluteA.getRepository().strippedName()).isEqualTo("");
@@ -101,10 +98,12 @@ public class PackageIdentifierTest {
}
@Test
- public void testRunfilesDir() throws Exception {
- assertThat(PackageIdentifier.create("@foo", new PathFragment("bar/baz")).getRunfilesPath())
+ public void testPathUnderExecRoot() throws Exception {
+ assertThat(
+ PackageIdentifier.create("@foo", new PathFragment("bar/baz")).getPathUnderExecRoot())
.isEqualTo(new PathFragment("../foo/bar/baz"));
- assertThat(PackageIdentifier.create("@", new PathFragment("bar/baz")).getRunfilesPath())
+ assertThat(
+ PackageIdentifier.create("@", new PathFragment("bar/baz")).getPathUnderExecRoot())
.isEqualTo(new PathFragment("bar/baz"));
}
}
diff --git a/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java b/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java
index 9a39bbfda1..24a19172c7 100644
--- a/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java
+++ b/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java
@@ -58,12 +58,12 @@ public class RepositoryNameTest {
}
@Test
- public void testRunfilesDir() throws Exception {
- assertThat(RepositoryName.create("@foo").getRunfilesPath())
+ public void testPathUnderExecRoot() throws Exception {
+ assertThat(RepositoryName.create("@foo").getPathUnderExecRoot())
.isEqualTo(new PathFragment("../foo"));
- assertThat(RepositoryName.create("@").getRunfilesPath())
+ assertThat(RepositoryName.create("@").getPathUnderExecRoot())
.isEqualTo(PathFragment.EMPTY_FRAGMENT);
- assertThat(RepositoryName.create("").getRunfilesPath())
+ assertThat(RepositoryName.create("").getPathUnderExecRoot())
.isEqualTo(PathFragment.EMPTY_FRAGMENT);
}