From 1f9eaea71632df84130e5c0958bc18120998a3b7 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 19 May 2019 23:09:15 -0700 Subject: [PATCH] Workaround a Doxygen bug The version of Doxygen used by Travis CI thinks that the global `std::regex` variables need to have a `\return` type annotation (they don't). Make them local to the function again and add a TODO. Signed-off-by: Enji Cooper --- engine/googletest_list.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/engine/googletest_list.cpp b/engine/googletest_list.cpp index 56c5fa22..2b0a9f97 100644 --- a/engine/googletest_list.cpp +++ b/engine/googletest_list.cpp @@ -51,18 +51,6 @@ const std::string name_expr = "([[:alpha:][:digit:]_]+[[:alpha:][:digit:]_/]*)"; /// The separator between a test suite and a test case. const std::string testsuite_testcase_separator = "."; -/// A complete regular expression representing a line with a test case -/// definition, e,g., " TestCase", " TestCase/0", or -/// " TestCase/0 # GetParam() = 4". -const std::regex testcase_re( - " " + name_expr + "([[:space:]]+# GetParam\\(\\) = .+)?"); - -/// A complete regular expression representing a line with a test suite -/// definition, e,g., * "TestSuite.", "TestSuite/Prefix.", or -/// "TestSuite/Prefix. # TypeParam = .+". -const std::regex testsuite_re( - name_expr + "\\.([[:space:]]+# TypeParam = .+)?"); - } // anonymous namespace @@ -78,6 +66,22 @@ engine::parse_googletest_list(std::istream& input) { std::string line, test_suite; + // TODO: These were moved here from the anonymous namespace because of a + // Doxygen bug that's reproducible with the version used by Travis CI. + // + /// A complete regular expression representing a line with a test case + /// definition, e,g., " TestCase", " TestCase/0", or + /// " TestCase/0 # GetParam() = 4". + const std::regex testcase_re( + " " + name_expr + "([[:space:]]+# GetParam\\(\\) = .+)?"); + + /// A complete regular expression representing a line with a test suite + /// definition, e,g., * "TestSuite.", "TestSuite/Prefix.", or + /// "TestSuite/Prefix. # TypeParam = .+". + const std::regex testsuite_re( + name_expr + "\\.([[:space:]]+# TypeParam = .+)?"); + // END TODO + model::test_cases_map_builder test_cases_builder; while (std::getline(input, line).good()) { std::smatch match;