From a7a7c561524d3fc7e3606c983ede3445c2deb550 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Tue, 9 Aug 2016 14:14:15 -0600 Subject: [PATCH] Workaround flaky complexity_test.cc test case. See https://github.com/google/benchmark/issues/272 --- test/complexity_test.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/complexity_test.cc b/test/complexity_test.cc index db04183d..50ea223e 100644 --- a/test/complexity_test.cc +++ b/test/complexity_test.cc @@ -172,16 +172,19 @@ BENCHMARK(BM_Complexity_O1) -> Range(1, 1<<18) -> Complexity([](int){return 1.0; const char* big_o_1_test_name = "BM_Complexity_O1_BigO"; const char* rms_o_1_test_name = "BM_Complexity_O1_RMS"; -const char* enum_auto_big_o_1 = "\\([0-9]+\\)"; +const char* enum_big_o_1 = "\\([0-9]+\\)"; +// FIXME: Tolerate both '(1)' and 'lgN' as output when the complexity is auto deduced. +// See https://github.com/google/benchmark/issues/272 +const char* auto_big_o_1 = "(\\([0-9]+\\))|(lgN)"; const char* lambda_big_o_1 = "f\\(N\\)"; // Add enum tests ADD_COMPLEXITY_CASES(&ConsoleOutputTests, &JSONOutputTests, &CSVOutputTests, - big_o_1_test_name, rms_o_1_test_name, enum_auto_big_o_1); + big_o_1_test_name, rms_o_1_test_name, enum_big_o_1); // Add auto enum tests ADD_COMPLEXITY_CASES(&ConsoleOutputTests, &JSONOutputTests, &CSVOutputTests, - big_o_1_test_name, rms_o_1_test_name, enum_auto_big_o_1); + big_o_1_test_name, rms_o_1_test_name, auto_big_o_1); // Add lambda tests ADD_COMPLEXITY_CASES(&ConsoleOutputTests, &JSONOutputTests, &CSVOutputTests,