aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java
diff options
context:
space:
mode:
authorGravatar Carmi Grushko <carmi@google.com>2017-02-17 06:49:40 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2017-02-17 14:55:06 +0000
commit0fd73d6e3602003ae0e7e9ce6a25b27d73e30076 (patch)
tree0547ba510e475322ee512255a8d471ca5ad07fd0 /src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java
parent8153cb80f4a4424640e694cb6ed4792dcc193171 (diff)
--proto_compiler points at @com_google_protobuf//:protoc
This allows proto_library to be used out of the box by adding a repository entry that points to the protobuf distro in one's WORKSPACE file. -- PiperOrigin-RevId: 147808147 MOS_MIGRATED_REVID=147808147
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java
index 1133f24b8e..893e4f82ff 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java
@@ -34,7 +34,8 @@ public class BazelProtoLibraryTest extends BuildViewTestCase {
@Before
public void setUp() throws Exception {
- scratch.file("third_party/protobuf/BUILD", "licenses(['notice'])", "exports_files(['protoc'])");
+ useConfiguration("--proto_compiler=//proto:compiler");
+ scratch.file("proto/BUILD", "licenses(['notice'])", "exports_files(['compiler'])");
}
@Test
@@ -180,7 +181,7 @@ public class BazelProtoLibraryTest extends BuildViewTestCase {
@Test
public void testDescriptorSetOutput_strictDeps() throws Exception {
- useConfiguration("--strict_proto_deps=error");
+ useConfiguration("--proto_compiler=//proto:compiler", "--strict_proto_deps=error");
scratch.file(
"x/BUILD",
"proto_library(name='nodeps', srcs=['nodeps.proto'])",
@@ -210,7 +211,7 @@ public class BazelProtoLibraryTest extends BuildViewTestCase {
*/
@Test
public void testDescriptorSetOutput_strict_deps_multipleSrcs() throws Exception {
- useConfiguration("--strict_proto_deps=error");
+ useConfiguration("--proto_compiler=//proto:compiler", "--strict_proto_deps=error");
ConfiguredTarget target =
scratchConfiguredTarget(
"x", "foo", "proto_library(name='foo', srcs=['foo.proto', 'bar.proto'])");
@@ -223,7 +224,7 @@ public class BazelProtoLibraryTest extends BuildViewTestCase {
@Test
public void testDescriptorSetOutput_strictDeps_disabled() throws Exception {
- useConfiguration("--strict_proto_deps=off");
+ useConfiguration("--proto_compiler=//proto:compiler", "--strict_proto_deps=off");
scratch.file("x/BUILD", "proto_library(name='foo', srcs=['foo.proto'])");
for (String arg :
@@ -238,7 +239,7 @@ public class BazelProtoLibraryTest extends BuildViewTestCase {
*/
@Test
public void strictCanDependOnNonStrict() throws Exception {
- useConfiguration("--strict_proto_deps=strict");
+ useConfiguration("--proto_compiler=//proto:compiler", "--strict_proto_deps=strict");
scratch.file(
"x/BUILD",
"proto_library(name = 'foo', deps = [':bar'], strict_proto_deps=1)",