From 7b62e40a64537dcfd5a3f93cb40282119aebbe7a Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Fri, 9 Sep 2022 12:58:17 -0400 Subject: 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`). --- Tests/RunCMake/CommandLine/P_working-dir.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- cgit v0.12