Skip to content
Snippets Groups Projects
Commit b73578f4 authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge pull request #643 from nicolasnoble/gflags

Making the usage of gflags uniform across distributions.
parents a52ba57e 7e80efcb
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,13 @@ DEFINE_string(oauth_scope, ...@@ -60,6 +60,13 @@ DEFINE_string(oauth_scope,
"https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform",
"Scope for OAuth tokens."); "Scope for OAuth tokens.");
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google { }
namespace gflags { }
using namespace google;
using namespace gflags;
namespace { namespace {
const char kTopic[] = "testtopics"; const char kTopic[] = "testtopics";
...@@ -81,7 +88,7 @@ grpc::string GetServiceAccountJsonKey() { ...@@ -81,7 +88,7 @@ grpc::string GetServiceAccountJsonKey() {
int main(int argc, char** argv) { int main(int argc, char** argv) {
grpc_init(); grpc_init();
google::ParseCommandLineFlags(&argc, &argv, true); ParseCommandLineFlags(&argc, &argv, true);
gpr_log(GPR_INFO, "Start PUBSUB client"); gpr_log(GPR_INFO, "Start PUBSUB client");
std::ostringstream ss; std::ostringstream ss;
......
...@@ -92,6 +92,13 @@ using grpc::testing::StreamingOutputCallRequest; ...@@ -92,6 +92,13 @@ using grpc::testing::StreamingOutputCallRequest;
using grpc::testing::StreamingOutputCallResponse; using grpc::testing::StreamingOutputCallResponse;
using grpc::testing::TestService; using grpc::testing::TestService;
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google { }
namespace gflags { }
using namespace google;
using namespace gflags;
namespace { namespace {
// The same value is defined by the Java client. // The same value is defined by the Java client.
const std::vector<int> request_stream_sizes = {27182, 8, 1828, 45904}; const std::vector<int> request_stream_sizes = {27182, 8, 1828, 45904};
...@@ -386,7 +393,7 @@ void DoPingPong() { ...@@ -386,7 +393,7 @@ void DoPingPong() {
int main(int argc, char** argv) { int main(int argc, char** argv) {
grpc_init(); grpc_init();
google::ParseCommandLineFlags(&argc, &argv, true); ParseCommandLineFlags(&argc, &argv, true);
if (FLAGS_test_case == "empty_unary") { if (FLAGS_test_case == "empty_unary") {
DoEmpty(); DoEmpty();
......
...@@ -73,6 +73,13 @@ using grpc::testing::StreamingOutputCallResponse; ...@@ -73,6 +73,13 @@ using grpc::testing::StreamingOutputCallResponse;
using grpc::testing::TestService; using grpc::testing::TestService;
using grpc::Status; using grpc::Status;
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google { }
namespace gflags { }
using namespace google;
using namespace gflags;
bool SetPayload(PayloadType type, int size, Payload* payload) { bool SetPayload(PayloadType type, int size, Payload* payload) {
PayloadType response_type = type; PayloadType response_type = type;
// TODO(yangg): Support UNCOMPRESSABLE payload. // TODO(yangg): Support UNCOMPRESSABLE payload.
...@@ -217,7 +224,7 @@ void RunServer() { ...@@ -217,7 +224,7 @@ void RunServer() {
int main(int argc, char** argv) { int main(int argc, char** argv) {
grpc_init(); grpc_init();
google::ParseCommandLineFlags(&argc, &argv, true); ParseCommandLineFlags(&argc, &argv, true);
GPR_ASSERT(FLAGS_port != 0); GPR_ASSERT(FLAGS_port != 0);
RunServer(); RunServer();
......
...@@ -80,6 +80,13 @@ using grpc::testing::SimpleResponse; ...@@ -80,6 +80,13 @@ using grpc::testing::SimpleResponse;
using grpc::testing::StatsRequest; using grpc::testing::StatsRequest;
using grpc::testing::TestService; using grpc::testing::TestService;
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google { }
namespace gflags { }
using namespace google;
using namespace gflags;
static double now() { static double now() {
gpr_timespec tv = gpr_now(); gpr_timespec tv = gpr_now();
return 1e9 * tv.tv_sec + tv.tv_nsec; return 1e9 * tv.tv_sec + tv.tv_nsec;
...@@ -221,7 +228,7 @@ void RunTest(const int client_threads, const int client_channels, ...@@ -221,7 +228,7 @@ void RunTest(const int client_threads, const int client_channels,
int main(int argc, char **argv) { int main(int argc, char **argv) {
grpc_init(); grpc_init();
google::ParseCommandLineFlags(&argc, &argv, true); ParseCommandLineFlags(&argc, &argv, true);
GPR_ASSERT(FLAGS_server_port); GPR_ASSERT(FLAGS_server_port);
......
...@@ -68,6 +68,13 @@ using grpc::testing::StatsRequest; ...@@ -68,6 +68,13 @@ using grpc::testing::StatsRequest;
using grpc::testing::TestService; using grpc::testing::TestService;
using grpc::Status; using grpc::Status;
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google { }
namespace gflags { }
using namespace google;
using namespace gflags;
static bool got_sigint = false; static bool got_sigint = false;
static void sigint_handler(int x) { got_sigint = 1; } static void sigint_handler(int x) { got_sigint = 1; }
...@@ -149,7 +156,7 @@ static void RunServer() { ...@@ -149,7 +156,7 @@ static void RunServer() {
int main(int argc, char** argv) { int main(int argc, char** argv) {
grpc_init(); grpc_init();
google::ParseCommandLineFlags(&argc, &argv, true); ParseCommandLineFlags(&argc, &argv, true);
signal(SIGINT, sigint_handler); signal(SIGINT, sigint_handler);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment