aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2017-09-05 18:31:10 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-09-06 10:10:09 +0200
commite0dfb3c3d70efc49c703be7e4c8e93c8a6b38d6b (patch)
treede98ba794d396262407e19b2bb6a08580b9a4dd0 /src/test/java/com/google/devtools/build/lib
parent268c0bcbf79f9f3f72d95fa51af0f1b18c5ce29e (diff)
Update LocalRepositoryLookupFunction to also return the path of the
repository. Part of #3553. Change-Id: Id8b4958844b2ad7b5ce4b2ea00a91b6b22acc025 PiperOrigin-RevId: 167589110
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java
index 12230c48d9..610eb728ef 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java
@@ -139,6 +139,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
lookupDirectory(RootedPath.toRootedPath(rootDirectory, PathFragment.EMPTY_FRAGMENT));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository()).isEqualTo(RepositoryName.MAIN);
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.EMPTY_FRAGMENT);
}
@Test
@@ -149,6 +150,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
lookupDirectory(RootedPath.toRootedPath(rootDirectory, PathFragment.create("some/path")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository()).isEqualTo(RepositoryName.MAIN);
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.EMPTY_FRAGMENT);
}
@Test
@@ -161,6 +163,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
lookupDirectory(RootedPath.toRootedPath(rootDirectory, PathFragment.create("local/repo")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository().getName()).isEqualTo("@local");
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.create("local/repo"));
}
@Test
@@ -175,6 +178,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
rootDirectory.getRelative("/abs"), PathFragment.create("local/repo")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository().getName()).isEqualTo("@local");
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.create("/abs/local/repo"));
}
@Test
@@ -187,6 +191,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
lookupDirectory(RootedPath.toRootedPath(rootDirectory, PathFragment.create("local/repo")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository().getName()).isEqualTo("@local");
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.create("local/repo"));
}
@Test
@@ -201,6 +206,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
rootDirectory.getRelative("/abs"), PathFragment.create("local/repo")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository().getName()).isEqualTo("@local");
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.create("/abs/local/repo"));
}
@Test
@@ -215,6 +221,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
RootedPath.toRootedPath(rootDirectory, PathFragment.create("local/repo/sub/package")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository().getName()).isEqualTo("@local");
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.create("local/repo"));
}
@Test
@@ -227,6 +234,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
lookupDirectory(RootedPath.toRootedPath(rootDirectory, PathFragment.create("local/repo")));
assertThat(repositoryLookupValue).isNotNull();
assertThat(repositoryLookupValue.getRepository()).isEqualTo(RepositoryName.MAIN);
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.EMPTY_FRAGMENT);
}
@Test
@@ -265,6 +273,7 @@ public class LocalRepositoryLookupFunctionTest extends FoundationTestCase {
assertThat(repositoryLookupValue).isNotNull();
// In this case, the repository should be MAIN as we can't find any local_repository rules.
assertThat(repositoryLookupValue.getRepository()).isEqualTo(RepositoryName.MAIN);
+ assertThat(repositoryLookupValue.getPath()).isEqualTo(PathFragment.EMPTY_FRAGMENT);
}
// TODO(katre): Add tests for the following exceptions