diff options
author | adelez <adelez@google.com> | 2018-02-01 12:40:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-01 12:40:48 -0800 |
commit | 4f8b322b74f4fcb9be4decef51927ff6aea51cb2 (patch) | |
tree | fb1a48eb9037bbe612bf5261b1f83882e907cf71 | |
parent | f4a94b61266dc468af2de213ea50b997a39b7508 (diff) | |
parent | 2294031d6a01493e24f32ba0d55dad7349349e7a (diff) |
Merge pull request #14266 from adelez/fix_grpc_tool_test
Fix echo.proto path under bazel
-rw-r--r-- | src/proto/grpc/testing/BUILD | 5 | ||||
-rw-r--r-- | test/cpp/util/BUILD | 4 | ||||
-rw-r--r-- | test/cpp/util/grpc_tool_test.cc | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 7c49fe2472..b8e9a22ab3 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -18,6 +18,11 @@ load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") grpc_package(name = "testing", visibility = "public") +exports_files([ + "echo.proto", + "echo_messages.proto", +]) + grpc_proto_library( name = "compiler_test_proto", srcs = ["compiler_test.proto"], diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index 19e15b1adf..af25fca185 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -140,6 +140,10 @@ grpc_cc_test( srcs = [ "grpc_tool_test.cc", ], + data = [ + "//src/proto/grpc/testing:echo.proto", + "//src/proto/grpc/testing:echo_messages.proto" + ], deps = [ ":grpc_cli_libs", ":test_util", diff --git a/test/cpp/util/grpc_tool_test.cc b/test/cpp/util/grpc_tool_test.cc index 0b599f4eeb..135cfdc1f3 100644 --- a/test/cpp/util/grpc_tool_test.cc +++ b/test/cpp/util/grpc_tool_test.cc @@ -31,6 +31,7 @@ #include <grpc/grpc.h> #include <gtest/gtest.h> +#include "src/core/lib/gpr/env.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "src/proto/grpc/testing/echo.pb.h" #include "test/core/util/port.h" @@ -87,6 +88,7 @@ DECLARE_bool(l); DECLARE_bool(batch); DECLARE_string(metadata); DECLARE_string(protofiles); +DECLARE_string(proto_path); namespace { @@ -707,6 +709,10 @@ TEST_F(GrpcToolTest, CallCommandWithBadMetadata) { const char* argv[] = {"grpc_cli", "call", "localhost:10000", "Echo", "message: 'Hello'"}; FLAGS_protofiles = "src/proto/grpc/testing/echo.proto"; + char* test_srcdir = gpr_getenv("TEST_SRCDIR"); + if (test_srcdir != nullptr) { + FLAGS_proto_path = test_srcdir + std::string("/com_github_grpc_grpc"); + } { std::stringstream output_stream; |