Tests: Avoid output when running symlink check

Since commit 58d10cf6f1 (Alternative symlink-creating mode for
file(INSTALL ...), 2021-08-02) we test creating a symlink during
configuration to decide whether to activate some tests.  Capture
the process output during the check to avoid leaking the error
message on failure.
This commit is contained in:
Brad King
2021-09-17 09:28:57 -04:00
parent 241048d6ce
commit 6ea883d652

View File

@@ -1656,6 +1656,8 @@ if(BUILD_TESTING)
"${CMake_SOURCE_DIR}/Tests/CMakeLists.txt" # random source file that exists
"${CMake_BINARY_DIR}/Tests/try_to_create_symlink" # random target file in existing directory
RESULT_VARIABLE _symlink_result
OUTPUT_VARIABLE _symlink_stdout
ERROR_VARIABLE _symlink_stderr
)
if(_symlink_result EQUAL 0)
file(REMOVE "${CMake_BINARY_DIR}/Tests/try_to_create_symlink")