brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · df98369 Raw
54 lines · plain
1.. title:: clang-tidy - google-upgrade-googletest-case2 3google-upgrade-googletest-case4==============================5 6Finds uses of deprecated Google Test version 1.9 APIs with names containing7``case`` and replaces them with equivalent APIs with ``suite``.8 9All names containing ``case`` are being replaced to be consistent with the10meanings of "test case" and "test suite" as used by the International11Software Testing Qualifications Board and ISO 29119.12 13The new names are a part of Google Test version 1.9 (release pending). It is14recommended that users update their dependency to version 1.9 and then use this15check to remove deprecated names.16 17The affected APIs are:18 19- Member functions of ``testing::Test``, ``testing::TestInfo``,20  ``testing::TestEventListener``, ``testing::UnitTest``, and any type21  inheriting from these types22- The macros ``TYPED_TEST_CASE``, ``TYPED_TEST_CASE_P``,23  ``REGISTER_TYPED_TEST_CASE_P``, and ``INSTANTIATE_TYPED_TEST_CASE_P``24- The type alias ``testing::TestCase``25 26Examples of fixes created by this check:27 28.. code-block:: c++29 30  class FooTest : public testing::Test {31  public:32    static void SetUpTestCase();33    static void TearDownTestCase();34  };35 36  TYPED_TEST_CASE(BarTest, BarTypes);37 38becomes39 40.. code-block:: c++41 42  class FooTest : public testing::Test {43  public:44    static void SetUpTestSuite();45    static void TearDownTestSuite();46  };47 48  TYPED_TEST_SUITE(BarTest, BarTypes);49 50For better consistency of user code, the check renames both virtual and51non-virtual member functions with matching names in derived types. The check52tries to provide only a warning when a fix cannot be made safely, as is the case53with some template and macro uses.54