From 81522c8ebeb97e906f2f0ece1b15266434c364af Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 1 Aug 2017 16:07:33 -0700 Subject: [PATCH] Add unsecure libraries to bazel build targets --- test/core/util/BUILD | 24 +++++++++++++++++- test/cpp/common/BUILD | 2 +- test/cpp/microbenchmarks/BUILD | 4 +-- test/cpp/server/BUILD | 8 +++--- test/cpp/util/BUILD | 45 ++++++++++++++++++++-------------- 5 files changed, 56 insertions(+), 27 deletions(-) diff --git a/test/core/util/BUILD b/test/core/util/BUILD index 9d899bc7beb..1268c2cd103 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -38,7 +38,7 @@ grpc_cc_library( ) grpc_cc_library( - name = "grpc_test_util", + name = "grpc_test_util_base", srcs = [ "debugger_macros.c", "grpc_profiler.c", @@ -68,10 +68,32 @@ grpc_cc_library( language = "C", deps = [ ":gpr_test_util", + "//:grpc_common", + ], +) + +grpc_cc_library( + name = "grpc_test_util", + srcs = [], + hdrs = [], + language = "C", + deps = [ + ":grpc_test_util_base", "//:grpc", ], ) +grpc_cc_library( + name = "grpc_test_util_unsecure", + srcs = [], + hdrs = [], + language = "C", + deps = [ + ":grpc_test_util_base", + "//:grpc_unsecure", + ], +) + grpc_cc_library( name = "one_corpus_entry_fuzzer", srcs = ["one_corpus_entry_fuzzer.c"], diff --git a/test/cpp/common/BUILD b/test/cpp/common/BUILD index bd1173322a7..be9c279f13e 100644 --- a/test/cpp/common/BUILD +++ b/test/cpp/common/BUILD @@ -27,7 +27,7 @@ grpc_cc_test( name = "alarm_cpp_test", srcs = ["alarm_cpp_test.cc"], deps = [ - "//:grpc++", + "//:grpc++_unsecure", "//test/core/util:gpr_test_util", ], external_deps = [ diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD index 5e1bcee89ff..442da38426d 100644 --- a/test/cpp/microbenchmarks/BUILD +++ b/test/cpp/microbenchmarks/BUILD @@ -40,9 +40,9 @@ grpc_cc_library( "helpers.h", ], deps = [ - "//:grpc++", + "//:grpc++_unsecure", "//src/proto/grpc/testing:echo_proto", - "//test/core/util:grpc_test_util", + "//test/core/util:grpc_test_util_unsecure", ], external_deps = [ "benchmark", diff --git a/test/cpp/server/BUILD b/test/cpp/server/BUILD index 512241e3504..3f63be2aa33 100644 --- a/test/cpp/server/BUILD +++ b/test/cpp/server/BUILD @@ -20,9 +20,9 @@ grpc_cc_test( name = "server_builder_test", srcs = ["server_builder_test.cc"], deps = [ - "//:grpc++", + "//:grpc++_unsecure", "//src/proto/grpc/testing:echo_proto", - "//test/core/util:grpc_test_util", + "//test/core/util:grpc_test_util_unsecure", ], external_deps = [ "gtest", @@ -33,9 +33,9 @@ grpc_cc_test( name = "server_request_call_test", srcs = ["server_request_call_test.cc"], deps = [ - "//:grpc++", + "//:grpc++_unsecure", "//src/proto/grpc/testing:echo_proto", - "//test/core/util:grpc_test_util", + "//test/core/util:grpc_test_util_unsecure", ], external_deps = [ "gtest", diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index c9b0d6c1df7..fbdec056989 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -24,16 +24,6 @@ package( ], ) -# The following builds a shared-object to confirm that grpc++_unsecure -# builds properly. Build-only is sufficient here -grpc_cc_binary( - name = "testso.so", - srcs = [], - linkshared = 1, - linkopts = ['-Wl,--no-undefined'], - deps = ["//:grpc++_unsecure"], -) - grpc_cc_library( name = "test_config", srcs = [ @@ -64,26 +54,43 @@ grpc_cc_library( ], ) +GRPCXX_TESTUTIL_SRCS = [ + "byte_buffer_proto_helper.cc", + "string_ref_helper.cc", + "subprocess.cc", +] + +GRPCXX_TESTUTIL_HDRS = [ + "byte_buffer_proto_helper.h", + "string_ref_helper.h", + "subprocess.h", +] + grpc_cc_library( name = "test_util", - srcs = [ - "byte_buffer_proto_helper.cc", + srcs = GRPCXX_TESTUTIL_SRCS + [ "create_test_channel.cc", - "string_ref_helper.cc", - "subprocess.cc", "test_credentials_provider.cc", ], - hdrs = [ - "byte_buffer_proto_helper.h", + hdrs = GRPCXX_TESTUTIL_HDRS + [ "create_test_channel.h", - "string_ref_helper.h", - "subprocess.h", "test_credentials_provider.h", ], deps = [ "//:grpc++", "//test/core/end2end:ssl_test_data", - "//test/core/util:gpr_test_util", + ], + external_deps = [ + "protobuf", + ], +) + +grpc_cc_library( + name = "test_util_unsecure", + srcs = GRPCXX_TESTUTIL_SRCS, + hdrs = GRPCXX_TESTUTIL_HDRS, + deps = [ + "//:grpc++_unsecure", ], external_deps = [ "protobuf",