[Cmake-commits] [cmake-commits] king committed GetFilenameComponentRealpathTest.cmake.in 1.1 1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Nov 18 10:56:42 EST 2009
Update of /cvsroot/CMake/CMake/Tests/CMakeTests
In directory public:/mounts/ram/cvs-serv32276/Tests/CMakeTests
Modified Files:
GetFilenameComponentRealpathTest.cmake.in
Log Message:
Fix get_filename_component(... REALPATH) work dir
The commit "Fix get_filename_component ABSOLUTE mode" broke REALPATH
treatment of relative paths because it stopped storing the absolute path
in local variable 'filename'. This commit fixes the call to GetRealPath
to use the proper local variable and adds a test.
Index: GetFilenameComponentRealpathTest.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** GetFilenameComponentRealpathTest.cmake.in 9 Feb 2009 14:23:55 -0000 1.1
--- GetFilenameComponentRealpathTest.cmake.in 18 Nov 2009 15:56:40 -0000 1.2
***************
*** 14,17 ****
--- 14,32 ----
#
+ # 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
#
More information about the Cmake-commits
mailing list