From 3a1a2f0a10569910ddaeba7b422f21ea2ed296ec Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Tue, 19 Dec 2017 16:43:50 -0800 Subject: Use the same ParseCommandLineFlags for golden file test that is used in other test binaries --- test/cpp/codegen/golden_file_test.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/cpp/codegen') diff --git a/test/cpp/codegen/golden_file_test.cc b/test/cpp/codegen/golden_file_test.cc index 14880982b5..7e4d15a7c9 100644 --- a/test/cpp/codegen/golden_file_test.cc +++ b/test/cpp/codegen/golden_file_test.cc @@ -22,6 +22,13 @@ #include #include +// 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; + DEFINE_string( generated_file_path, "", "path to the directory containing generated files compiler_test.grpc.pb.h" @@ -60,7 +67,7 @@ TEST(GoldenMockFileTest, TestGeneratedMockFile) { int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); - ::google::ParseCommandLineFlags(&argc, &argv, true); + ParseCommandLineFlags(&argc, &argv, true); if (FLAGS_generated_file_path.empty()) { FLAGS_generated_file_path = "gens/src/proto/grpc/testing/"; } -- cgit v1.2.3