]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: make GTEST_PARALLEL_COMMAND visible to all test directories 69601/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Fri, 19 Jun 2026 06:38:10 +0000 (14:38 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Fri, 19 Jun 2026 15:09:22 +0000 (23:09 +0800)
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 <sunyuechi@iscas.ac.cn>
cmake/modules/AddCephTest.cmake

index 83f442aec19b133ff7bac590d54b920542330dbc..49562e569b09003c5bc12de38318d2d3c0415941 100644 (file)
@@ -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()