diff options
author | 2018-05-22 10:12:38 -0700 | |
---|---|---|
committer | 2018-05-22 10:12:38 -0700 | |
commit | ba221d0423e61451b660b3d551c25cf155709285 (patch) | |
tree | 40e37ad629686a673e97b0dc2fd1f093595c07f4 /test/cpp/microbenchmarks/bm_cq_multiple_threads.cc | |
parent | 92ff0490edfcfdb082659fa13a10ce8857ddd48e (diff) | |
parent | 463e4d56193bbaec3977ce38fb8f0103d006794e (diff) |
Merge branch 'master' into prototype-cfstream
Diffstat (limited to 'test/cpp/microbenchmarks/bm_cq_multiple_threads.cc')
-rw-r--r-- | test/cpp/microbenchmarks/bm_cq_multiple_threads.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index ec79b95cd8..da095c3e68 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -24,6 +24,7 @@ #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/port.h" @@ -164,4 +165,15 @@ BENCHMARK(BM_Cq_Throughput)->ThreadRange(1, 16)->UseRealTime(); } // namespace testing } // namespace grpc -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; +} |