mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-30 19:57:41 +00:00
GoogleTest: Avoid cluttering custom working directory during discovery
Since commit 1cdceae8e3 (GoogleTest: Parse discovered test list from
JSON output if supported, 2025-05-02, v4.2.0-rc1~533^2~2) we've placed
the discovery JSON files in the working directory provided by the user.
Place them in the current build tree folder instead.
Fixes: #27840
This commit is contained in:
committed by
Brad King
parent
cdd5dbbba5
commit
b5f555f687
@@ -700,6 +700,7 @@ function(gtest_discover_tests target)
|
||||
" TEST_DISCOVERY_TIMEOUT" " [==[${arg_DISCOVERY_TIMEOUT}]==]" "\n"
|
||||
" TEST_DISCOVERY_EXTRA_ARGS [==[${arg_DISCOVERY_EXTRA_ARGS}]==]" "\n"
|
||||
" TEST_XML_OUTPUT_DIR" " [==[${arg_XML_OUTPUT_DIR}]==]" "\n"
|
||||
" TEST_JSON_OUTPUT_DIR" " [==[${CMAKE_CURRENT_BINARY_DIR}]==]" "\n"
|
||||
")" "\n"
|
||||
)
|
||||
file(GENERATE OUTPUT "${discovery_file}" CONTENT "${discovery_content}")
|
||||
|
||||
@@ -143,6 +143,7 @@ function(gtest_discover_tests_impl)
|
||||
CTEST_FILE
|
||||
TEST_DISCOVERY_TIMEOUT
|
||||
TEST_XML_OUTPUT_DIR
|
||||
TEST_JSON_OUTPUT_DIR
|
||||
TEST_FILTER
|
||||
)
|
||||
set(multiValueArgs
|
||||
@@ -202,7 +203,7 @@ function(gtest_discover_tests_impl)
|
||||
string(SHA256 target_hash "${arg_TEST_TARGET}")
|
||||
string(SUBSTRING "${target_hash}" 0 10 target_hash)
|
||||
set(json_file
|
||||
"${arg_TEST_WORKING_DIR}/cmake_test_discovery_${target_hash}.json"
|
||||
"${arg_TEST_JSON_OUTPUT_DIR}/cmake_test_discovery_${target_hash}.json"
|
||||
)
|
||||
|
||||
# Remove json file to make sure we don't pick up an outdated one
|
||||
|
||||
Reference in New Issue
Block a user