| 1 |
.. title:: clang-tidy - google-readability-avoid-underscore-in-googletest-name |
| 2 |
|
| 3 |
google-readability-avoid-underscore-in-googletest-name |
| 4 |
====================================================== |
| 5 |
|
| 6 |
Checks whether there are underscores in googletest test suite names and test |
| 7 |
names in test macros: |
| 8 |
|
| 9 |
- ``TEST`` |
| 10 |
- ``TEST_F`` |
| 11 |
- ``TEST_P`` |
| 12 |
- ``TYPED_TEST`` |
| 13 |
- ``TYPED_TEST_P`` |
| 14 |
|
| 15 |
The ``FRIEND_TEST`` macro is not included. |
| 16 |
|
| 17 |
For example: |
| 18 |
|
| 19 |
.. code-block:: c++ |
| 20 |
|
| 21 |
TEST(TestSuiteName, Illegal_TestName) {} |
| 22 |
TEST(Illegal_TestSuiteName, TestName) {} |
| 23 |
|
| 24 |
would trigger the check. `Underscores are not allowed`_ in test suite name nor |
| 25 |
test names. |
| 26 |
|
| 27 |
The ``DISABLED_`` prefix, which may be used to |
| 28 |
`disable test suites and individual tests`_, is removed from the test suite name |
| 29 |
and test name before checking for underscores. |
| 30 |
|
| 31 |
This check does not propose any fixes. |
| 32 |
|
| 33 |
.. _Underscores are not allowed: https://google.github.io/googletest/faq.html#why-should-test-suite-names-and-test-names-not-contain-underscore |
| 34 |
.. _disable test suites and individual tests: https://google.github.io/googletest/advanced.html#temporarily-disabling-tests |