[PATCH] D56424: [clang-tidy] Add check for underscores in googletest names.

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 8 10:39:11 PST 2019


MyDeveloperDay added inline comments.


================
Comment at: clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp:27
+static bool isGoogletestTestMacro(StringRef MacroName) {
+  static const llvm::StringSet<> MacroNames = {"TEST", "TEST_F", "TEST_P",
+                                               "TYPED_TEST", "TYPED_TEST_P"};
----------------
Is there value in making the list of macros and option?, I've worked with other unit testing packages (some inhouse) that use the same format as google test, but don't use TEST() itself

e.g.  (to name a few)

```
TEST_CASE(testclass, testname)
BOOST_TEST(statement, floating_point_comparison_manipulation);
BOOST_DATA_TEST_CASE(test_case_name, dataset)
BOOST_FIXTURE_TEST_CASE( test_case2, F )
BOOST_AUTO_TEST_CASE( test_case3 )

```

too many for you to capture in the checker...but a nice addition for those who use alternative frameworks and would like to benefit from similar  "no underscore" naming conventions



Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56424/new/

https://reviews.llvm.org/D56424





More information about the cfe-commits mailing list