Skip to content

Commit

Permalink
Workaround a Doxygen bug
Browse files Browse the repository at this point in the history
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 <yaneurabeya@gmail.com>
  • Loading branch information
ngie-eign committed May 20, 2019
1 parent 6348bf0 commit 1f9eaea
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions engine/googletest_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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;
Expand Down

0 comments on commit 1f9eaea

Please sign in to comment.