From 0705c6d60b152bc5e705ddf3b35f5f7dc0a33259 Mon Sep 17 00:00:00 2001 From: Sun Yuechi Date: Fri, 19 Jun 2026 14:38:10 +0800 Subject: [PATCH] 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 --- cmake/modules/AddCephTest.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() -- 2.47.3