aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-09-16 16:07:16 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-09-16 16:07:16 -0700
commita964cbafbabb6d8aaca4d5252dcbf2aab6a7af50 (patch)
tree0661cc385a62852ac2eb06dd5984817daa301dc2 /test/cpp/util
parent94d786fd4ca5e7898648a838ad1d23581077e1a4 (diff)
parent5098508d2d41a116113f7e333c516cd9ef34a943 (diff)
Merge remote-tracking branch 'upstream/master' into cli_type_fork
Diffstat (limited to 'test/cpp/util')
-rw-r--r--test/cpp/util/grpc_tool.cc22
-rw-r--r--test/cpp/util/grpc_tool.h2
-rw-r--r--test/cpp/util/metrics_server.cc1
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.h2
-rw-r--r--test/cpp/util/test_config_cc.cc (renamed from test/cpp/util/test_config.cc)0
-rw-r--r--test/cpp/util/test_credentials_provider.cc1
6 files changed, 16 insertions, 12 deletions
diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc
index 4feb2dcbaa..159c01c896 100644
--- a/test/cpp/util/grpc_tool.cc
+++ b/test/cpp/util/grpc_tool.cc
@@ -57,7 +57,7 @@ DEFINE_bool(remotedb, true, "Use server types to parse and format messages");
DEFINE_string(metadata, "",
"Metadata to send to server, in the form of key1:val1:key2:val2");
DEFINE_string(proto_path, ".", "Path to look for the proto file.");
-DEFINE_string(proto_file, "", "Name of the proto file.");
+DEFINE_string(protofiles, "", "Name of the proto file.");
DEFINE_bool(binary_input, false, "Input in binary format");
DEFINE_bool(binary_output, false, "Output in binary format");
DEFINE_string(infile, "", "Input file (default is stdin)");
@@ -71,9 +71,9 @@ class GrpcTool {
explicit GrpcTool();
virtual ~GrpcTool() {}
- bool Help(int argc, const char** argv, CliCredentials cred,
+ bool Help(int argc, const char** argv, const CliCredentials& cred,
GrpcToolOutputCallback callback);
- bool CallMethod(int argc, const char** argv, CliCredentials cred,
+ bool CallMethod(int argc, const char** argv, const CliCredentials& cred,
GrpcToolOutputCallback callback);
bool PrintType(int argc, const char** argv, CliCredentials cred,
GrpcToolOutputCallback callback);
@@ -101,7 +101,7 @@ class GrpcTool {
};
template <typename T>
-std::function<bool(GrpcTool*, int, const char**, const CliCredentials,
+std::function<bool(GrpcTool*, int, const char**, const CliCredentials&,
GrpcToolOutputCallback)>
BindWith5Args(T&& func) {
return std::bind(std::forward<T>(func), std::placeholders::_1,
@@ -156,7 +156,7 @@ void PrintMetadata(const T& m, const grpc::string& message) {
struct Command {
const char* command;
- std::function<bool(GrpcTool*, int, const char**, const CliCredentials,
+ std::function<bool(GrpcTool*, int, const char**, const CliCredentials&,
GrpcToolOutputCallback)>
function;
int min_args;
@@ -201,7 +201,7 @@ const Command* FindCommand(const grpc::string& name) {
}
} // namespace
-int GrpcToolMainLib(int argc, const char** argv, const CliCredentials cred,
+int GrpcToolMainLib(int argc, const char** argv, const CliCredentials& cred,
GrpcToolOutputCallback callback) {
if (argc < 2) {
Usage("No command specified");
@@ -238,7 +238,7 @@ void GrpcTool::CommandUsage(const grpc::string& usage) const {
}
}
-bool GrpcTool::Help(int argc, const char** argv, const CliCredentials cred,
+bool GrpcTool::Help(int argc, const char** argv, const CliCredentials& cred,
GrpcToolOutputCallback callback) {
CommandUsage(
"Print help\n"
@@ -285,7 +285,7 @@ bool GrpcTool::PrintType(int argc, const char** argv, CliCredentials cred,
}
bool GrpcTool::CallMethod(int argc, const char** argv,
- const CliCredentials cred,
+ const CliCredentials& cred,
GrpcToolOutputCallback callback) {
CommandUsage(
"Call method\n"
@@ -294,10 +294,10 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
" <service> ; Exported service name\n"
" <method> ; Method name\n"
" <request> ; Text protobuffer (overrides infile)\n"
- " --proto_file ; Comma separated proto files used as a"
+ " --protofiles ; Comma separated proto files used as a"
" fallback when parsing request/response\n"
" --proto_path ; The search path of proto files, valid"
- " only when --proto_file is given\n"
+ " only when --protofiles is given\n"
" --metadata ; The metadata to be sent to the server\n"
" --infile ; Input filename (defaults to stdin)\n"
" --outfile ; Output filename (defaults to stdout)\n"
@@ -337,7 +337,7 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
if (!FLAGS_binary_input || !FLAGS_binary_output) {
parser.reset(
new grpc::testing::ProtoFileParser(FLAGS_remotedb ? channel : nullptr,
- FLAGS_proto_path, FLAGS_proto_file));
+ FLAGS_proto_path, FLAGS_protofiles));
if (parser->HasError()) {
return false;
}
diff --git a/test/cpp/util/grpc_tool.h b/test/cpp/util/grpc_tool.h
index 3da86937c2..df3680258b 100644
--- a/test/cpp/util/grpc_tool.h
+++ b/test/cpp/util/grpc_tool.h
@@ -45,7 +45,7 @@ namespace testing {
typedef std::function<bool(const grpc::string &)> GrpcToolOutputCallback;
-int GrpcToolMainLib(int argc, const char **argv, CliCredentials cred,
+int GrpcToolMainLib(int argc, const char **argv, const CliCredentials &cred,
GrpcToolOutputCallback callback);
} // namespace testing
diff --git a/test/cpp/util/metrics_server.cc b/test/cpp/util/metrics_server.cc
index 1c7cd6382a..9296d6515e 100644
--- a/test/cpp/util/metrics_server.cc
+++ b/test/cpp/util/metrics_server.cc
@@ -35,6 +35,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
+#include <grpc/support/log.h>
#include "src/proto/grpc/testing/metrics.grpc.pb.h"
#include "src/proto/grpc/testing/metrics.pb.h"
diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h
index eb7cf4907d..0e69696d5f 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.h
+++ b/test/cpp/util/proto_reflection_descriptor_database.h
@@ -45,6 +45,8 @@
#include <grpc++/ext/reflection.grpc.pb.h>
#endif // GRPC_NO_GENERATED_CODE
#include <grpc++/grpc++.h>
+#include <grpc++/impl/codegen/config_protobuf.h>
+
namespace grpc {
// ProtoReflectionDescriptorDatabase takes a stub of ServerReflection and
diff --git a/test/cpp/util/test_config.cc b/test/cpp/util/test_config_cc.cc
index 8711746129..8711746129 100644
--- a/test/cpp/util/test_config.cc
+++ b/test/cpp/util/test_config_cc.cc
diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc
index 6e68f59e6a..ca15f29795 100644
--- a/test/cpp/util/test_credentials_provider.cc
+++ b/test/cpp/util/test_credentials_provider.cc
@@ -37,6 +37,7 @@
#include <unordered_map>
#include <grpc++/impl/sync.h>
+#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "test/core/end2end/data/ssl_test_data.h"