Debian Codegraph @

llvm-project/clang-tools-extra/docs/clang-tidy/checks/google/readability-avoid-underscore-in-googletest-name.rst

raw
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 and test case names in
7 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(TestCaseName, Illegal_TestName) {}
22 TEST(Illegal_TestCaseName, TestName) {}
23
24 would trigger the check. `Underscores are not allowed`_ in test names nor test
25 case names.
26
27 The ``DISABLED_`` prefix, which may be used to `disable individual tests`_, is
28 ignored when checking test names, but the rest of the rest of the test name is
29 still checked.
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 individual tests: https://google.github.io/googletest/advanced.html#temporarily-disabling-tests