1 | // RUN: %check_clang_tidy %s google-readability-avoid-underscore-in-googletest-name %t |
2 | |
3 | #define TEST(test_suite_name, test_name) void test_suite_name##test_name() |
4 | #define TEST_F(test_suite_name, test_name) void test_suite_name##test_name() |
5 | #define TEST_P(test_suite_name, test_name) void test_suite_name##test_name() |
6 | #define TYPED_TEST(test_suite_name, test_name) void test_suite_name##test_name() |
7 | #define TYPED_TEST_P(test_suite_name, test_name) void test_suite_name##test_name() |
8 | #define FRIEND_TEST(test_suite_name, test_name) void test_suite_name##test_name() |
9 | |
10 | TEST(TestSuiteName, Illegal_TestName) {} |
11 | // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
12 | |
13 | TEST(TestSuiteName, DISABLED_Illegal_TestName) {} |
14 | // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
15 | TEST(TestSuiteName, Illegal_Test_Name) {} |
16 | // 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] |
17 | TEST(Illegal_TestSuiteName, TestName) {} |
18 | // 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] |
19 | TEST(Illegal_Test_SuiteName, TestName) {} |
20 | // 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] |
21 | TEST(Illegal_TestSuiteName, Illegal_TestName) {} |
22 | // 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] |
23 | // CHECK-MESSAGES: :[[@LINE-2]]:29: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
24 | |
25 | TEST_F(TestSuiteFixtureName, Illegal_TestName) {} |
26 | // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
27 | TEST_F(TestSuiteFixtureName, DISABLED_Illegal_Test_Name) {} |
28 | // 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] |
29 | TEST_F(TestSuiteFixtureName, Illegal_Test_Name) {} |
30 | // 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] |
31 | |
32 | TEST_F(Illegal_TestSuiteFixtureName, TestName) {} |
33 | // 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] |
34 | TEST_F(Illegal_TestSuiteFixtureName, Illegal_TestName) {} |
35 | // 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] |
36 | // CHECK-MESSAGES: :[[@LINE-2]]:38: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
37 | |
38 | TEST_F(Illegal_Test_SuiteFixtureName, TestName) {} |
39 | // 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] |
40 | |
41 | TEST_P(ParameterizedTestSuiteFixtureName, Illegal_TestName) {} |
42 | // CHECK-MESSAGES: :[[@LINE-1]]:43: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
43 | TEST_P(ParameterizedTestSuiteFixtureName, DISABLED_Illegal_TestName) {} |
44 | // CHECK-MESSAGES: :[[@LINE-1]]:43: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
45 | TEST_P(ParameterizedTestSuiteFixtureName, Illegal_Test_Name) {} |
46 | // 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] |
47 | |
48 | TEST_P(Illegal_ParameterizedTestSuiteFixtureName, TestName) {} |
49 | // 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] |
50 | TEST_P(Illegal_ParameterizedTestSuiteFixtureName, Illegal_TestName) {} |
51 | // 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] |
52 | // CHECK-MESSAGES: :[[@LINE-2]]:51: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
53 | |
54 | TEST_P(Illegal_Parameterized_TestSuiteFixtureName, TestName) {} |
55 | // 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] |
56 | |
57 | TYPED_TEST(TypedTestSuiteName, Illegal_TestName) {} |
58 | // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
59 | TYPED_TEST(TypedTestSuiteName, DISABLED_Illegal_TestName) {} |
60 | // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
61 | TYPED_TEST(TypedTestSuiteName, Illegal_Test_Name) {} |
62 | // 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] |
63 | |
64 | TYPED_TEST(Illegal_TypedTestSuiteName, TestName) {} |
65 | // 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] |
66 | TYPED_TEST(Illegal_TypedTestSuiteName, Illegal_TestName) {} |
67 | // 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] |
68 | // CHECK-MESSAGES: :[[@LINE-2]]:40: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
69 | |
70 | TYPED_TEST(Illegal_Typed_TestSuiteName, TestName) {} |
71 | // 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] |
72 | |
73 | TYPED_TEST_P(TypeParameterizedTestSuiteName, Illegal_TestName) {} |
74 | // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
75 | TYPED_TEST_P(TypeParameterizedTestSuiteName, DISABLED_Illegal_TestName) {} |
76 | // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
77 | TYPED_TEST_P(TypeParameterizedTestSuiteName, Illegal_Test_Name) {} |
78 | // 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] |
79 | |
80 | TYPED_TEST_P(Illegal_TypeParameterizedTestSuiteName, TestName) {} |
81 | // 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] |
82 | TYPED_TEST_P(Illegal_TypeParameterizedTestSuiteName, Illegal_TestName) {} |
83 | // 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] |
84 | // CHECK-MESSAGES: :[[@LINE-2]]:54: warning: avoid using "_" in test name "Illegal_TestName" according to Googletest FAQ [google-readability-avoid-underscore-in-googletest-name] |
85 | |
86 | TYPED_TEST_P(Illegal_Type_ParameterizedTestSuiteName, TestName) {} |
87 | // 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] |
88 | |
89 | // Underscores are allowed to disable a test with the DISABLED_ prefix. |
90 | // https://google.github.io/googletest/faq.html#why-should-test-suite-names-and-test-names-not-contain-underscore |
91 | TEST(TestSuiteName, TestName) {} |
92 | TEST(TestSuiteName, DISABLED_TestName) {} |
93 | TEST(DISABLED_TestSuiteName, TestName) {} |
94 | TEST(DISABLED_TestSuiteName, DISABLED_TestName) {} |
95 | |
96 | TEST_F(TestSuiteFixtureName, TestName) {} |
97 | TEST_F(TestSuiteFixtureName, DISABLED_TestName) {} |
98 | TEST_F(DISABLED_TestSuiteFixtureName, TestName) {} |
99 | TEST_F(DISABLED_TestSuiteFixtureName, DISABLED_TestName) {} |
100 | |
101 | TEST_P(ParameterizedTestSuiteFixtureName, TestName) {} |
102 | TEST_P(ParameterizedTestSuiteFixtureName, DISABLED_TestName) {} |
103 | TEST_P(DISABLED_ParameterizedTestSuiteFixtureName, TestName) {} |
104 | TEST_P(DISABLED_ParameterizedTestSuiteFixtureName, DISABLED_TestName) {} |
105 | |
106 | TYPED_TEST(TypedTestSuiteName, TestName) {} |
107 | TYPED_TEST(TypedTestSuiteName, DISABLED_TestName) {} |
108 | TYPED_TEST(DISABLED_TypedTestSuiteName, TestName) {} |
109 | TYPED_TEST(DISABLED_TypedTestSuiteName, DISABLED_TestName) {} |
110 | |
111 | TYPED_TEST_P(TypeParameterizedTestSuiteName, TestName) {} |
112 | TYPED_TEST_P(TypeParameterizedTestSuiteName, DISABLED_TestName) {} |
113 | TYPED_TEST_P(DISABLED_TypeParameterizedTestSuiteName, TestName) {} |
114 | TYPED_TEST_P(DISABLED_TypeParameterizedTestSuiteName, DISABLED_TestName) {} |
115 | |
116 | FRIEND_TEST(FriendTestSuite, Is_NotChecked) {} |
117 | FRIEND_TEST(Friend_TestSuite, IsNotChecked) {} |
118 | FRIEND_TEST(Friend_TestSuite, Is_NotChecked) {} |
119 | |