aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/interop/server_helper.h
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2018-05-03 23:00:30 -0700
committerGravatar Alexander Polcyn <apolcyn@google.com>2018-05-03 23:01:43 -0700
commit11c1739a104d5270e514fc8addb93fb1fe3c35ea (patch)
tree7ac0cb668d5ccf99e7ce6210106bd58944b0cab9 /test/cpp/interop/server_helper.h
parent2d894a8c3b6bd0a236f14c5630faced4caba0a55 (diff)
Provide a way to run C++ interop server with custom ServerBuilderOptions
Diffstat (limited to 'test/cpp/interop/server_helper.h')
-rw-r--r--test/cpp/interop/server_helper.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/cpp/interop/server_helper.h b/test/cpp/interop/server_helper.h
index 3004e7ff81..265874df70 100644
--- a/test/cpp/interop/server_helper.h
+++ b/test/cpp/interop/server_helper.h
@@ -26,6 +26,8 @@
#include <grpc/impl/codegen/atm.h>
#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
namespace grpc {
@@ -72,6 +74,28 @@ void RunServer(std::shared_ptr<ServerCredentials> creds);
void RunServer(std::shared_ptr<ServerCredentials> creds, int port,
ServerStartedCondition* server_started_condition);
+/// Run gRPC interop server.
+///
+/// \param creds The credentials associated with the server.
+/// \param server_options List of options to set when building the server.
+void RunServer(
+ std::shared_ptr<ServerCredentials> creds,
+ std::unique_ptr<std::vector<std::unique_ptr<ServerBuilderOption>>>
+ server_options);
+
+/// Run gRPC interop server.
+///
+/// \param creds The credentials associated with the server.
+/// \param port Port to use for the server.
+/// \param server_options List of options to set when building the server.
+/// \param server_started_condition (optional) Struct holding mutex, condition
+// variable, and condition used to notify when the server has started.
+void RunServer(
+ std::shared_ptr<ServerCredentials> creds, const int port,
+ ServerStartedCondition* server_started_condition,
+ std::unique_ptr<std::vector<std::unique_ptr<grpc::ServerBuilderOption>>>
+ server_options);
+
} // namespace interop
} // namespace testing
} // namespace grpc