mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
Tests: Isolate tests from CTEST_USE_INSTRUMENTATION variable
Prevent CMake's own tests from gathering instrumentation data when `CTEST_USE_INSTRUMENTATION` is enabled in the environment. Fixes: #26916
This commit is contained in:
@@ -36,6 +36,8 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/CheckSwift.cmake)
|
||||
set(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome")
|
||||
set(TEST_CONFIG_ENV_CODE "# Isolate tests from user-wide configuration.
|
||||
set(ENV{CMAKE_CONFIG_DIR} \"${TEST_HOME}/.config/cmake\")\n")
|
||||
set(TEST_INSTRUMENTATION_ENV_CODE "# Isolate tests from CTEST_USE_INSTRUMENTATION var
|
||||
unset(ENV{CTEST_USE_INSTRUMENTATION})\n")
|
||||
file(MAKE_DIRECTORY "${TEST_HOME}/.config/cmake")
|
||||
|
||||
# Fake a user home directory to avoid polluting the real one.
|
||||
|
||||
@@ -45,3 +45,4 @@ set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} 100)
|
||||
@TEST_CONFIG_ENV_CODE@
|
||||
@TEST_HOME_ENV_CODE@
|
||||
@TEST_WARN_VS_CODE@
|
||||
@TEST_INSTRUMENTATION_ENV_CODE@
|
||||
|
||||
Reference in New Issue
Block a user