summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-09 16:58:17 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-12 13:45:50 (GMT)
commit7b62e40a64537dcfd5a3f93cb40282119aebbe7a (patch)
treec1d15a308665eabbfbcac74f566f743b9c4e5c4d /Tests
parent83686df1d63e7d2c922de19489ea2bab42e98a4a (diff)
downloadCMake-7b62e40a64537dcfd5a3f93cb40282119aebbe7a.zip
CMake-7b62e40a64537dcfd5a3f93cb40282119aebbe7a.tar.gz
CMake-7b62e40a64537dcfd5a3f93cb40282119aebbe7a.tar.bz2
Tests: Fix RunCMake.CommandLine test in unusual environments
Modify `Tests/RunCMake/CommandLine/P_working-dir.cmake` to not spuriously fail in environments when the build directory's nominal path is not canonicalized (i.e. `realpath(BINDIR) != BINDIR`).
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/P_working-dir.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tests/RunCMake/CommandLine/P_working-dir.cmake b/Tests/RunCMake/CommandLine/P_working-dir.cmake
index 4ea0293..e2c0378 100644
--- a/Tests/RunCMake/CommandLine/P_working-dir.cmake
+++ b/Tests/RunCMake/CommandLine/P_working-dir.cmake
@@ -9,6 +9,11 @@ foreach(d CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRE
if(EXPECTED_WORKING_DIR STREQUAL "${${d}}")
message(STATUS "${d} is the expected working directory (${EXPECTED_WORKING_DIR})")
else()
- message(FATAL_ERROR "${d} = \"${${d}}\" is not the expected working directory (${EXPECTED_WORKING_DIR})")
+ get_filename_component(resolved "${EXPECTED_WORKING_DIR}" REALPATH)
+ if(resolved STREQUAL "${${d}}")
+ message(STATUS "${d} is the expected working directory (${resolved}) after symlink resolution")
+ else()
+ message(FATAL_ERROR "${d} = \"${${d}}\" is not the expected working directory (${EXPECTED_WORKING_DIR})")
+ endif()
endif()
endforeach()