Tests/RunCMake/cmake_host_system_information: Cover macOS Malloc Debugging env

On macOS, `sw_vers` may print to `stderr` based on environment variables
like `MallocGuardEdges=1`.  Add a test to verify that we do not capture
that as part of the information it prints to `stdout`.

Issue: #26466
This commit is contained in:
Brad King
2024-11-22 10:19:45 -05:00
parent 954afd528b
commit 58aa659bf8
3 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1 @@
-- os_name='(macOS|Mac OS X)'

View File

@@ -0,0 +1,3 @@
set(ENV{MallocGuardEdges} 1) # test tolerating sw_vers stderr
cmake_host_system_information(RESULT os_name QUERY OS_NAME)
message(STATUS "os_name='${os_name}'")

View File

@@ -14,6 +14,10 @@ run_cmake(Ubuntu)
run_cmake(CentOS6)
run_cmake(Debian6)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
run_cmake(MacOS)
endif()
run_cmake(UserFallbackScript)
if(RunCMake_GENERATOR MATCHES "Visual Studio")