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>
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()