]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
neorados/test: Simplify copy prevention by using GtestNonCopyable
authorKefu Chai <tchaikov@gmail.com>
Sun, 30 Mar 2025 02:56:05 +0000 (10:56 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 30 Mar 2025 03:31:40 +0000 (11:31 +0800)
commit9a49523b3dc554a547c5f19a2b0d20980bc692f2
treefcb2f6b821a415b468618a885d0a27acffdbd88f
parent21f67af89261fb999419c51738b51be81fbf3516
neorados/test: Simplify copy prevention by using GtestNonCopyable

Updates the test framework to use GoogleTest's simplified copy
prevention mechanism by inheriting from
`::testing::internal::GtestNonCopyable` instead of custom macros.

This change:
- Replaces deprecated GTEST_DISALLOW_* macros that were removed in
  GoogleTest (https://github.com/google/googletest/commit/bf66935e07825318ae519675d73d0f3e313b3ec6)
- Aligns with GoogleTest's current approach for preventing test suite
  copying, See
  https://github.com/google/googletest/commit/93f08be653c36ddc6943e9513fc14c7292b4d007
- Enables updating the GoogleTest submodule to silence CMake warnings
- Improves compatibility with recent distro-packaged GoogleTest versions
- add the minimal required GTest version when finding this package,
  this change should have no impact to our packaging. as both deb
  and rpm packagings are using bundled googletest submodule. and
  googletest 1.14 has been included by recent stable releases of
  popular distros, like fedora 41 and ubuntu 24.04.
While `GtestNonCopyable` is technically an internal helper, we already
use other helpers from the `::testing::internal` namespace, so this
change maintains consistency with our existing approach.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/CMakeLists.txt
src/test/neorados/common_tests.h