From 275932bf0852431b6f307ba9c45f26073d20ac62 Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Mon, 12 Jul 2021 16:58:30 -0700 Subject: [PATCH] Drop dedicated benchmark lifecycle. Instead, roll the output scraping into the main runner. Pass a perf flag to the runner in order to control leak checking, apply tags via the macro and appropriately disable logging. This may be removed in the future. PiperOrigin-RevId: 384348035 --- test/util/test_util_impl.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/util/test_util_impl.cc b/test/util/test_util_impl.cc index 7e1ad9e66..6b6826898 100644 --- a/test/util/test_util_impl.cc +++ b/test/util/test_util_impl.cc @@ -20,6 +20,7 @@ #include "benchmark/benchmark.h" #include "test/util/logging.h" +extern bool FLAGS_gtest_list_tests; extern bool FLAGS_benchmark_list_tests; extern std::string FLAGS_benchmark_filter; @@ -40,12 +41,18 @@ void TestInit(int* argc, char*** argv) { } int RunAllTests() { - if (FLAGS_benchmark_list_tests || FLAGS_benchmark_filter != ".") { - benchmark::RunSpecifiedBenchmarks(); - return 0; - } else { + if (::testing::FLAGS_gtest_list_tests) { return RUN_ALL_TESTS(); } + if (FLAGS_benchmark_list_tests) { + benchmark::RunSpecifiedBenchmarks(); + return 0; + } + + // Run selected tests & benchmarks. + int rc = RUN_ALL_TESTS(); + benchmark::RunSpecifiedBenchmarks(); + return rc; } } // namespace testing