Commit de149317 authored by Brad King's avatar Brad King
Browse files

Tests: Use upper-case drive letters in RunCMake.get_filename_component

With the most recent KWSys update, the "actual case" operation on
Windows always upper-cases the drive letter now even for absolute paths
that do not exist.  Use an upper-case drive letter in the test so that
it can tolerate this operation on Windows and the lack of this operation
elsewhere.
parent 04d94fbe
...@@ -19,12 +19,12 @@ foreach(c DIRECTORY NAME EXT NAME_WE PATH) ...@@ -19,12 +19,12 @@ foreach(c DIRECTORY NAME EXT NAME_WE PATH)
endforeach() endforeach()
# Test Windows paths with DIRECTORY component and an absolute Windows path. # Test Windows paths with DIRECTORY component and an absolute Windows path.
get_filename_component(test_slashes "c:\\path\\to\\filename.ext.in" DIRECTORY) get_filename_component(test_slashes "C:\\path\\to\\filename.ext.in" DIRECTORY)
check("DIRECTORY from backslashes" "${test_slashes}" "c:/path/to") check("DIRECTORY from backslashes" "${test_slashes}" "C:/path/to")
list(APPEND non_cache_vars test_slashes) list(APPEND non_cache_vars test_slashes)
get_filename_component(test_winroot "c:\\filename.ext.in" DIRECTORY) get_filename_component(test_winroot "C:\\filename.ext.in" DIRECTORY)
check("DIRECTORY in windows root" "${test_winroot}" "c:/") check("DIRECTORY in windows root" "${test_winroot}" "C:/")
list(APPEND non_cache_vars test_winroot) list(APPEND non_cache_vars test_winroot)
# Test finding absolute paths. # Test finding absolute paths.
...@@ -33,8 +33,8 @@ check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in") ...@@ -33,8 +33,8 @@ check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in")
get_filename_component(test_absolute "/../path/to/filename.ext.in" ABSOLUTE) get_filename_component(test_absolute "/../path/to/filename.ext.in" ABSOLUTE)
check("ABSOLUTE .. in root" "${test_absolute}" "/path/to/filename.ext.in") check("ABSOLUTE .. in root" "${test_absolute}" "/path/to/filename.ext.in")
get_filename_component(test_absolute "c:/../path/to/filename.ext.in" ABSOLUTE) get_filename_component(test_absolute "C:/../path/to/filename.ext.in" ABSOLUTE)
check("ABSOLUTE .. in windows root" "${test_absolute}" "c:/path/to/filename.ext.in") check("ABSOLUTE .. in windows root" "${test_absolute}" "C:/path/to/filename.ext.in")
list(APPEND non_cache_vars test_absolute) list(APPEND non_cache_vars test_absolute)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment