diff options
Diffstat (limited to 'test/cpp/microbenchmarks/bm_call_create.cc')
-rw-r--r-- | test/cpp/microbenchmarks/bm_call_create.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 5c2c38c27d..831b29c506 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -23,11 +23,11 @@ #include <string.h> #include <sstream> -#include <grpc++/channel.h> -#include <grpc++/support/channel_arguments.h> #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/string_util.h> +#include <grpcpp/channel.h> +#include <grpcpp/support/channel_arguments.h> #include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/deadline/deadline_filter.h" @@ -46,6 +46,7 @@ #include "src/cpp/client/create_channel_internal.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -813,4 +814,15 @@ static void BM_IsolatedCall_StreamingSend(benchmark::State& state) { } BENCHMARK(BM_IsolatedCall_StreamingSend); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} |