From: Sun Yuechi Date: Fri, 19 Jun 2026 06:38:10 +0000 (+0800) Subject: cmake: make GTEST_PARALLEL_COMMAND visible to all test directories X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0705c6d60b152bc5e705ddf3b35f5f7dc0a33259;p=ceph.git cmake: make GTEST_PARALLEL_COMMAND visible to all test directories GTEST_PARALLEL_COMMAND was set as an ordinary variable inside the `if(NOT TARGET gtest-parallel_ext)` guard, so it only existed in the first directory that include()s AddCephTest (src/common/options). Later includes skip the guarded block and leave it empty, so PARALLEL unittests under src/test silently ran serially. Promote it to CACHE INTERNAL so it is visible across all directories regardless of include order. Signed-off-by: Sun Yuechi --- diff --git a/cmake/modules/AddCephTest.cmake b/cmake/modules/AddCephTest.cmake index 83f442aec19..49562e569b0 100644 --- a/cmake/modules/AddCephTest.cmake +++ b/cmake/modules/AddCephTest.cmake @@ -73,8 +73,11 @@ if(WITH_GTEST_PARALLEL) BUILD_COMMAND "" INSTALL_COMMAND "") add_dependencies(tests gtest-parallel_ext) + # CACHE INTERNAL: the set() runs only in the first directory to create the + # target, so a plain variable would be invisible to PARALLEL tests elsewhere. set(GTEST_PARALLEL_COMMAND - ${Python3_EXECUTABLE} ${gtest_parallel_source_dir}/gtest-parallel) + ${Python3_EXECUTABLE} ${gtest_parallel_source_dir}/gtest-parallel + CACHE INTERNAL "command to run a gtest binary through gtest-parallel") endif() endif()