summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-08-19 13:01:46 -0400
committerBrad King <brad.king@kitware.com>2021-08-19 13:04:47 -0400
commitf64e8036aa1498edc34b1624df9dc8633467e7ef (patch)
treed593fe63bfa3c400808b1eb2114b00a6b40dda0f /Tests
parent2a4a630f3acc83cd8eed95f940b54a851f9722d6 (diff)
downloadcmake-f64e8036aa1498edc34b1624df9dc8633467e7ef.tar.gz
Tests: Fix check to add InstallMode tests
The check added by commit 58d10cf6f1 (Alternative symlink-creating mode for file(INSTALL ...), 2021-08-02) only works when re-running CMake in a build tree after building `cmake`. Use the driving CMake to check instead. Remove the stray link after creation. Also remove the message on failure: we do not use that convention.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt9
1 files changed, 4 insertions, 5 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9dab5b9f77..76c6c05cde 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1649,15 +1649,14 @@ if(BUILD_TESTING)
DEPENDS ExternalProjectUpdateSetup )
execute_process(
- COMMAND ${CMAKE_CMAKE_COMMAND}
+ COMMAND ${CMAKE_COMMAND}
"-E" create_symlink
"${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 _failed
+ RESULT_VARIABLE _symlink_result
)
- if(_failed)
- message("Failed to create a simple symlink on this machine. Skipping InstallMode tests.")
- else()
+ if(_symlink_result EQUAL 0)
+ file(REMOVE "${CMake_BINARY_DIR}/Tests/try_to_create_symlink")
function(add_installmode_test _mode)
set(ENV{CMAKE_INSTALL_MODE} _mode)
set(_maybe_InstallMode_CTEST_OPTIONS)