35 lines · plain
1.. title:: clang-tidy - google-readability-avoid-underscore-in-googletest-name2 3google-readability-avoid-underscore-in-googletest-name4======================================================5 6Checks whether there are underscores in googletest test suite names and test7names in test macros:8 9- ``TEST``10- ``TEST_F``11- ``TEST_P``12- ``TYPED_TEST``13- ``TYPED_TEST_P``14 15The ``FRIEND_TEST`` macro is not included.16 17For example:18 19.. code-block:: c++20 21 TEST(TestSuiteName, Illegal_TestName) {}22 TEST(Illegal_TestSuiteName, TestName) {}23 24would trigger the check. `Underscores are not allowed`_ in test suite name nor25test names.26 27The ``DISABLED_`` prefix, which may be used to28`disable test suites and individual tests`_, is removed from the test suite29name and test name before checking for underscores.30 31This 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-underscore34.. _disable test suites and individual tests: https://google.github.io/googletest/advanced.html#temporarily-disabling-tests35