summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in')
-rw-r--r--Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
index c795512..7adc240 100644
--- a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
+++ b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
@@ -13,6 +13,21 @@ if(NOT nonexistent2 STREQUAL "${bindir}/THIS_IS_A_NONEXISTENT_FILE")
endif()
#
+# Test treatment of relative paths
+#
+foreach(c REALPATH ABSOLUTE)
+ get_filename_component(dir "subdir/THIS_IS_A_NONEXISTENT_FILE" ${c})
+ if(NOT "${dir}" STREQUAL "${bindir}/subdir/THIS_IS_A_NONEXISTENT_FILE")
+ message(FATAL_ERROR
+ "${c} does not handle relative paths. Expected:\n"
+ " ${bindir}/subdir/THIS_IS_A_NONEXISTENT_FILE\n"
+ "but got:\n"
+ " ${nonexistent1}\n"
+ )
+ endif()
+endforeach()
+
+#
# Test symbolic link resolution
#
if(UNIX)