• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. title:: clang-tidy - google-readability-avoid-underscore-in-googletest-name
2
3google-readability-avoid-underscore-in-googletest-name
4======================================================
5
6Checks whether there are underscores in googletest test and test case names in
7test 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(TestCaseName, Illegal_TestName) {}
22  TEST(Illegal_TestCaseName, TestName) {}
23
24would trigger the check. `Underscores are not allowed`_ in test names nor test
25case names.
26
27The ``DISABLED_`` prefix, which may be used to `disable individual tests`_, is
28ignored when checking test names, but the rest of the rest of the test name is
29still checked.
30
31This check does not propose any fixes.
32
33.. _Underscores are not allowed: https://github.com/google/googletest/blob/master/googletest/docs/faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore
34.. _disable individual tests: https://github.com/google/googletest/blob/master/googletest/docs/faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore
35