Merge topic 'fix-commandline-test-with-symlinks'

7b62e40a64 Tests: Fix RunCMake.CommandLine test in unusual environments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7660
This commit is contained in:
Brad King
2022-09-13 13:48:02 +00:00
committed by Kitware Robot

View File

@@ -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()