aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks/fullstack_fixtures.h
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2017-05-04 10:02:24 -0700
committerGravatar Vijay Pai <vpai@google.com>2017-07-14 16:23:54 -0700
commit3d7d5f4ed222b687ecbd03c172e1042b7d460304 (patch)
treea47a74501f11b78fd9642a6d507813a43b7d9ddb /test/cpp/microbenchmarks/fullstack_fixtures.h
parentabcdfc9676c46a7f04091cf0e7f84f0e2b3fcf86 (diff)
Create inproc transport, add relevant tests, exclude irrelevant tests
Diffstat (limited to 'test/cpp/microbenchmarks/fullstack_fixtures.h')
-rw-r--r--test/cpp/microbenchmarks/fullstack_fixtures.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h
index 2320086afc..5477b860b4 100644
--- a/test/cpp/microbenchmarks/fullstack_fixtures.h
+++ b/test/cpp/microbenchmarks/fullstack_fixtures.h
@@ -66,14 +66,21 @@ class FullstackFixture : public BaseFixture {
FullstackFixture(Service* service, const FixtureConfiguration& config,
const grpc::string& address) {
ServerBuilder b;
- b.AddListeningPort(address, InsecureServerCredentials());
+ if (address.length() > 0) {
+ b.AddListeningPort(address, InsecureServerCredentials());
+ }
cq_ = b.AddCompletionQueue(true);
b.RegisterService(service);
config.ApplyCommonServerBuilderConfig(&b);
server_ = b.BuildAndStart();
ChannelArguments args;
config.ApplyCommonChannelArguments(&args);
- channel_ = CreateCustomChannel(address, InsecureChannelCredentials(), args);
+ if (address.length() > 0) {
+ channel_ =
+ CreateCustomChannel(address, InsecureChannelCredentials(), args);
+ } else {
+ channel_ = server_->InProcessChannel(args);
+ }
}
virtual ~FullstackFixture() {
@@ -139,6 +146,15 @@ class UDS : public FullstackFixture {
}
};
+class InProcess : public FullstackFixture {
+ public:
+ InProcess(Service* service,
+ const FixtureConfiguration& fixture_configuration =
+ FixtureConfiguration())
+ : FullstackFixture(service, fixture_configuration, "") {}
+ ~InProcess() {}
+};
+
class EndpointPairFixture : public BaseFixture {
public:
EndpointPairFixture(Service* service, grpc_endpoint_pair endpoints,
@@ -279,6 +295,7 @@ class MinStackize : public Base {
typedef MinStackize<TCP> MinTCP;
typedef MinStackize<UDS> MinUDS;
+typedef MinStackize<InProcess> MinInProcess;
typedef MinStackize<SockPair> MinSockPair;
typedef MinStackize<InProcessCHTTP2> MinInProcessCHTTP2;