diff options
Diffstat (limited to 'Tests/RunCMake/CommandLine/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 6d69945..b20e683 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -348,6 +348,42 @@ run_cmake_command(E_create_symlink-no-replace-dir ${CMAKE_COMMAND} -E create_symlink T . ) +#create hard link tests +run_cmake_command(E_create_hardlink-no-arg + ${CMAKE_COMMAND} -E create_hardlink + ) + +set(dir ${RunCMake_BINARY_DIR}/hardlink_tests) +file(REMOVE_RECURSE "${dir}") +file(MAKE_DIRECTORY ${dir}) + +run_cmake_command(E_create_hardlink-non-existent-source + ${CMAKE_COMMAND} -E create_hardlink ${dir}/I_dont_exist ${dir}/link + ) + +file(TOUCH ${dir}/1) + +run_cmake_command(E_create_hardlink-ok + ${CMAKE_COMMAND} -E create_hardlink ${dir}/1 ${dir}/1-link + ) + +run_cmake_command(E_create_hardlink-no-directory + ${CMAKE_COMMAND} -E create_hardlink ${dir}/1 ${dir}/a/1-link + ) + +#On Windows, if the user does not have sufficient privileges +#don't fail this test +set(RunCMake_DEFAULT_stderr "(operation not permitted)?") +run_cmake_command(E_create_hardlink-unresolved-symlink-prereq + ${CMAKE_COMMAND} -E create_symlink ${dir}/1 ${dir}/1-symlink + ) +file(REMOVE ${dir}/1) + +run_cmake_command(E_create_hardlink-unresolved-symlink + ${CMAKE_COMMAND} -E create_hardlink ${dir}/1-symlink ${dir}/1s-link + ) +unset(RunCMake_DEFAULT_stderr) + set(in ${RunCMake_SOURCE_DIR}/copy_input) set(out ${RunCMake_BINARY_DIR}/copy_output) file(REMOVE_RECURSE "${out}") |