mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Tests/RunCMake/file-DOWNLOAD: Use /dev/urandom for write-error only on Apple
On other platforms, writing to `/dev/urandom` succeeds, so it cannot be used to simulate a write error. Fixes: #28047
This commit is contained in:
@@ -25,12 +25,13 @@ run_cmake(no-file)
|
||||
run_cmake(range)
|
||||
run_cmake(SHOW_PROGRESS)
|
||||
|
||||
foreach(file IN ITEMS /dev/full /dev/urandom)
|
||||
if(IS_WRITABLE "${file}")
|
||||
run_cmake_with_options(file-write-error -Dfile=${file})
|
||||
break()
|
||||
if(CMAKE_HOST_UNIX)
|
||||
if(IS_WRITABLE "/dev/full")
|
||||
run_cmake_with_options(file-write-error -Dfile=/dev/full)
|
||||
elseif(IS_WRITABLE "/dev/urandom" AND CMAKE_HOST_APPLE)
|
||||
run_cmake_with_options(file-write-error -Dfile=/dev/urandom)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT CMake_TEST_NO_NETWORK)
|
||||
run_cmake(bad-hostname)
|
||||
|
||||
Reference in New Issue
Block a user