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_error.cc | |
parent | 92ff0490edfcfdb082659fa13a10ce8857ddd48e (diff) | |
parent | 463e4d56193bbaec3977ce38fb8f0103d006794e (diff) |
Merge branch 'master' into prototype-cfstream
Diffstat (limited to 'test/cpp/microbenchmarks/bm_error.cc')
-rw-r--r-- | test/cpp/microbenchmarks/bm_error.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc index d12f475a49..ae557a580a 100644 --- a/test/cpp/microbenchmarks/bm_error.cc +++ b/test/cpp/microbenchmarks/bm_error.cc @@ -25,6 +25,7 @@ #include "src/core/lib/transport/error_utils.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -310,4 +311,15 @@ BENCHMARK_SUITE(ErrorWithGrpcStatus); BENCHMARK_SUITE(ErrorWithHttpError); BENCHMARK_SUITE(ErrorWithNestedGrpcStatus); -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; +} |