diff --git a/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp --- a/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp @@ -47,18 +47,19 @@ if (!isGoogletestTestMacro(MacroName) || !Args || Args->getNumMacroArguments() < 2) return; - const Token *TestCaseNameToken = Args->getUnexpArgument(0); + const Token *TestSuiteNameToken = Args->getUnexpArgument(0); const Token *TestNameToken = Args->getUnexpArgument(1); - if (!TestCaseNameToken || !TestNameToken) + if (!TestSuiteNameToken || !TestNameToken) return; - std::string TestCaseNameMaybeDisabled = PP->getSpelling(*TestCaseNameToken); - StringRef TestCaseName = TestCaseNameMaybeDisabled; - TestCaseName.consume_front(KDisabledTestPrefix); - if (TestCaseName.contains('_')) - Check->diag(TestCaseNameToken->getLocation(), - "avoid using \"_\" in test case name \"%0\" according to " + std::string TestSuiteNameMaybeDisabled = + PP->getSpelling(*TestSuiteNameToken); + StringRef TestSuiteName = TestSuiteNameMaybeDisabled; + TestSuiteName.consume_front(KDisabledTestPrefix); + if (TestSuiteName.contains('_')) + Check->diag(TestSuiteNameToken->getLocation(), + "avoid using \"_\" in test suite name \"%0\" according to " "Googletest FAQ") - << TestCaseName; + << TestSuiteName; std::string TestNameMaybeDisabled = PP->getSpelling(*TestNameToken); StringRef TestName = TestNameMaybeDisabled; diff --git a/clang-tools-extra/docs/clang-tidy/checks/google/readability-avoid-underscore-in-googletest-name.rst b/clang-tools-extra/docs/clang-tidy/checks/google/readability-avoid-underscore-in-googletest-name.rst --- a/clang-tools-extra/docs/clang-tidy/checks/google/readability-avoid-underscore-in-googletest-name.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google/readability-avoid-underscore-in-googletest-name.rst @@ -3,8 +3,8 @@ google-readability-avoid-underscore-in-googletest-name ====================================================== -Checks whether there are underscores in googletest test and test case names in -test macros: +Checks whether there are underscores in googletest test suite names and test +names in test macros: - ``TEST`` - ``TEST_F`` @@ -18,17 +18,17 @@ .. code-block:: c++ - TEST(TestCaseName, Illegal_TestName) {} - TEST(Illegal_TestCaseName, TestName) {} + TEST(TestSuiteName, Illegal_TestName) {} + TEST(Illegal_TestSuiteName, TestName) {} -would trigger the check. `Underscores are not allowed`_ in test names nor test -case names. +would trigger the check. `Underscores are not allowed`_ in test suite name nor +test names. -The ``DISABLED_`` prefix, which may be used to `disable individual tests`_, is -ignored when checking test names, but the rest of the rest of the test name is -still checked. +The ``DISABLED_`` prefix, which may be used to +`disable test suites and individual tests`_, is removed from the test suite name +and test name before checking for underscores. This check does not propose any fixes. .. _Underscores are not allowed: https://google.github.io/googletest/faq.html#why-should-test-suite-names-and-test-names-not-contain-underscore -.. _disable individual tests: https://google.github.io/googletest/advanced.html#temporarily-disabling-tests +.. _disable test suites and individual tests: https://google.github.io/googletest/advanced.html#temporarily-disabling-tests diff --git a/clang-tools-extra/test/clang-tidy/checkers/google/avoid-underscore-in-googletest-name.cpp b/clang-tools-extra/test/clang-tidy/checkers/google/avoid-underscore-in-googletest-name.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/google/avoid-underscore-in-googletest-name.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/google/avoid-underscore-in-googletest-name.cpp @@ -1,118 +1,118 @@ // RUN: %check_clang_tidy %s google-readability-avoid-underscore-in-googletest-name %t -#define TEST(test_case_name, test_name) void test_case_name##test_name() -#define TEST_F(test_case_name, test_name) void test_case_name##test_name() -#define TEST_P(test_case_name, test_name) void test_case_name##test_name() -#define TYPED_TEST(test_case_name, test_name) void test_case_name##test_name() -#define TYPED_TEST_P(test_case_name, test_name) void test_case_name##test_name() -#define FRIEND_TEST(test_case_name, test_name) void test_case_name##test_name() - -TEST(TestCaseName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST(TestCaseName, DISABLED_Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST(TestCaseName, Illegal_Test_Name) {} -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST(Illegal_TestCaseName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: avoid using "_" in test case name "Illegal_TestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST(Illegal_Test_CaseName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: avoid using "_" in test case name "Illegal_Test_CaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST(Illegal_TestCaseName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: avoid using "_" in test case name "Illegal_TestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -// CHECK-MESSAGES: :[[@LINE-2]]:28: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST_F(TestCaseFixtureName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST_F(TestCaseFixtureName, DISABLED_Illegal_Test_Name) {} -// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST_F(TestCaseFixtureName, Illegal_Test_Name) {} -// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST_F(Illegal_TestCaseFixtureName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test case name "Illegal_TestCaseFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST_F(Illegal_TestCaseFixtureName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test case name "Illegal_TestCaseFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -// CHECK-MESSAGES: :[[@LINE-2]]:37: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST_F(Illegal_Test_CaseFixtureName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test case name "Illegal_Test_CaseFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST_P(ParameterizedTestCaseFixtureName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST_P(ParameterizedTestCaseFixtureName, DISABLED_Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST_P(ParameterizedTestCaseFixtureName, Illegal_Test_Name) {} -// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST_P(Illegal_ParameterizedTestCaseFixtureName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test case name "Illegal_ParameterizedTestCaseFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TEST_P(Illegal_ParameterizedTestCaseFixtureName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test case name "Illegal_ParameterizedTestCaseFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -// CHECK-MESSAGES: :[[@LINE-2]]:50: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TEST_P(Illegal_Parameterized_TestCaseFixtureName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test case name "Illegal_Parameterized_TestCaseFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TYPED_TEST(TypedTestCaseName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TYPED_TEST(TypedTestCaseName, DISABLED_Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TYPED_TEST(TypedTestCaseName, Illegal_Test_Name) {} -// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TYPED_TEST(Illegal_TypedTestCaseName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: avoid using "_" in test case name "Illegal_TypedTestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TYPED_TEST(Illegal_TypedTestCaseName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: avoid using "_" in test case name "Illegal_TypedTestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -// CHECK-MESSAGES: :[[@LINE-2]]:39: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TYPED_TEST(Illegal_Typed_TestCaseName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: avoid using "_" in test case name "Illegal_Typed_TestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TYPED_TEST_P(TypeParameterizedTestCaseName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:45: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TYPED_TEST_P(TypeParameterizedTestCaseName, DISABLED_Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:45: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TYPED_TEST_P(TypeParameterizedTestCaseName, Illegal_Test_Name) {} -// CHECK-MESSAGES: :[[@LINE-1]]:45: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TYPED_TEST_P(Illegal_TypeParameterizedTestCaseName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: avoid using "_" in test case name "Illegal_TypeParameterizedTestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -TYPED_TEST_P(Illegal_TypeParameterizedTestCaseName, Illegal_TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: avoid using "_" in test case name "Illegal_TypeParameterizedTestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] -// CHECK-MESSAGES: :[[@LINE-2]]:53: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] - -TYPED_TEST_P(Illegal_Type_ParameterizedTestCaseName, TestName) {} -// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: avoid using "_" in test case name "Illegal_Type_ParameterizedTestCaseName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +#define TEST(test_suite_name, test_name) void test_suite_name##test_name() +#define TEST_F(test_suite_name, test_name) void test_suite_name##test_name() +#define TEST_P(test_suite_name, test_name) void test_suite_name##test_name() +#define TYPED_TEST(test_suite_name, test_name) void test_suite_name##test_name() +#define TYPED_TEST_P(test_suite_name, test_name) void test_suite_name##test_name() +#define FRIEND_TEST(test_suite_name, test_name) void test_suite_name##test_name() + +TEST(TestSuiteName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST(TestSuiteName, DISABLED_Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST(TestSuiteName, Illegal_Test_Name) {} +// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST(Illegal_TestSuiteName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: avoid using "_" in test suite name "Illegal_TestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST(Illegal_Test_SuiteName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: avoid using "_" in test suite name "Illegal_Test_SuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST(Illegal_TestSuiteName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: avoid using "_" in test suite name "Illegal_TestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +// CHECK-MESSAGES: :[[@LINE-2]]:29: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST_F(TestSuiteFixtureName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST_F(TestSuiteFixtureName, DISABLED_Illegal_Test_Name) {} +// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST_F(TestSuiteFixtureName, Illegal_Test_Name) {} +// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST_F(Illegal_TestSuiteFixtureName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test suite name "Illegal_TestSuiteFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST_F(Illegal_TestSuiteFixtureName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test suite name "Illegal_TestSuiteFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +// CHECK-MESSAGES: :[[@LINE-2]]:38: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST_F(Illegal_Test_SuiteFixtureName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test suite name "Illegal_Test_SuiteFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST_P(ParameterizedTestSuiteFixtureName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:43: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST_P(ParameterizedTestSuiteFixtureName, DISABLED_Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:43: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST_P(ParameterizedTestSuiteFixtureName, Illegal_Test_Name) {} +// CHECK-MESSAGES: :[[@LINE-1]]:43: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST_P(Illegal_ParameterizedTestSuiteFixtureName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test suite name "Illegal_ParameterizedTestSuiteFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TEST_P(Illegal_ParameterizedTestSuiteFixtureName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test suite name "Illegal_ParameterizedTestSuiteFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +// CHECK-MESSAGES: :[[@LINE-2]]:51: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TEST_P(Illegal_Parameterized_TestSuiteFixtureName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: avoid using "_" in test suite name "Illegal_Parameterized_TestSuiteFixtureName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TYPED_TEST(TypedTestSuiteName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TYPED_TEST(TypedTestSuiteName, DISABLED_Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TYPED_TEST(TypedTestSuiteName, Illegal_Test_Name) {} +// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TYPED_TEST(Illegal_TypedTestSuiteName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: avoid using "_" in test suite name "Illegal_TypedTestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TYPED_TEST(Illegal_TypedTestSuiteName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: avoid using "_" in test suite name "Illegal_TypedTestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +// CHECK-MESSAGES: :[[@LINE-2]]:40: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TYPED_TEST(Illegal_Typed_TestSuiteName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: avoid using "_" in test suite name "Illegal_Typed_TestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TYPED_TEST_P(TypeParameterizedTestSuiteName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:46: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TYPED_TEST_P(TypeParameterizedTestSuiteName, DISABLED_Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:46: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TYPED_TEST_P(TypeParameterizedTestSuiteName, Illegal_Test_Name) {} +// CHECK-MESSAGES: :[[@LINE-1]]:46: warning: avoid using "_" in test name "Illegal_Test_Name" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TYPED_TEST_P(Illegal_TypeParameterizedTestSuiteName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: avoid using "_" in test suite name "Illegal_TypeParameterizedTestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +TYPED_TEST_P(Illegal_TypeParameterizedTestSuiteName, Illegal_TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: avoid using "_" in test suite name "Illegal_TypeParameterizedTestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] +// CHECK-MESSAGES: :[[@LINE-2]]:54: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] + +TYPED_TEST_P(Illegal_Type_ParameterizedTestSuiteName, TestName) {} +// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: avoid using "_" in test suite name "Illegal_Type_ParameterizedTestSuiteName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] // Underscores are allowed to disable a test with the DISABLED_ prefix. // https://google.github.io/googletest/faq.html#why-should-test-suite-names-and-test-names-not-contain-underscore -TEST(TestCaseName, TestName) {} -TEST(TestCaseName, DISABLED_TestName) {} -TEST(DISABLED_TestCaseName, TestName) {} -TEST(DISABLED_TestCaseName, DISABLED_TestName) {} - -TEST_F(TestCaseFixtureName, TestName) {} -TEST_F(TestCaseFixtureName, DISABLED_TestName) {} -TEST_F(DISABLED_TestCaseFixtureName, TestName) {} -TEST_F(DISABLED_TestCaseFixtureName, DISABLED_TestName) {} - -TEST_P(ParameterizedTestCaseFixtureName, TestName) {} -TEST_P(ParameterizedTestCaseFixtureName, DISABLED_TestName) {} -TEST_P(DISABLED_ParameterizedTestCaseFixtureName, TestName) {} -TEST_P(DISABLED_ParameterizedTestCaseFixtureName, DISABLED_TestName) {} - -TYPED_TEST(TypedTestName, TestName) {} -TYPED_TEST(TypedTestName, DISABLED_TestName) {} -TYPED_TEST(DISABLED_TypedTestName, TestName) {} -TYPED_TEST(DISABLED_TypedTestName, DISABLED_TestName) {} - -TYPED_TEST_P(TypeParameterizedTestName, TestName) {} -TYPED_TEST_P(TypeParameterizedTestName, DISABLED_TestName) {} -TYPED_TEST_P(DISABLED_TypeParameterizedTestName, TestName) {} -TYPED_TEST_P(DISABLED_TypeParameterizedTestName, DISABLED_TestName) {} - -FRIEND_TEST(FriendTest, Is_NotChecked) {} -FRIEND_TEST(Friend_Test, IsNotChecked) {} -FRIEND_TEST(Friend_Test, Is_NotChecked) {} +TEST(TestSuiteName, TestName) {} +TEST(TestSuiteName, DISABLED_TestName) {} +TEST(DISABLED_TestSuiteName, TestName) {} +TEST(DISABLED_TestSuiteName, DISABLED_TestName) {} + +TEST_F(TestSuiteFixtureName, TestName) {} +TEST_F(TestSuiteFixtureName, DISABLED_TestName) {} +TEST_F(DISABLED_TestSuiteFixtureName, TestName) {} +TEST_F(DISABLED_TestSuiteFixtureName, DISABLED_TestName) {} + +TEST_P(ParameterizedTestSuiteFixtureName, TestName) {} +TEST_P(ParameterizedTestSuiteFixtureName, DISABLED_TestName) {} +TEST_P(DISABLED_ParameterizedTestSuiteFixtureName, TestName) {} +TEST_P(DISABLED_ParameterizedTestSuiteFixtureName, DISABLED_TestName) {} + +TYPED_TEST(TypedTestSuiteName, TestName) {} +TYPED_TEST(TypedTestSuiteName, DISABLED_TestName) {} +TYPED_TEST(DISABLED_TypedTestSuiteName, TestName) {} +TYPED_TEST(DISABLED_TypedTestSuiteName, DISABLED_TestName) {} + +TYPED_TEST_P(TypeParameterizedTestSuiteName, TestName) {} +TYPED_TEST_P(TypeParameterizedTestSuiteName, DISABLED_TestName) {} +TYPED_TEST_P(DISABLED_TypeParameterizedTestSuiteName, TestName) {} +TYPED_TEST_P(DISABLED_TypeParameterizedTestSuiteName, DISABLED_TestName) {} + +FRIEND_TEST(FriendTestSuite, Is_NotChecked) {} +FRIEND_TEST(Friend_TestSuite, IsNotChecked) {} +FRIEND_TEST(Friend_TestSuite, Is_NotChecked) {}