From 45aa9c65a13105ff505e18f5029ef794b7aef9ab Mon Sep 17 00:00:00 2001 From: Tushar Maheshwari Date: Thu, 27 Dec 2018 21:36:31 +0530 Subject: Tests: file CREATE_LINK subcommand test cases --- Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt | 1 + Tests/RunCMake/file/CREATE_LINK-noexist.cmake | 9 +++++++++ Tests/RunCMake/file/CREATE_LINK.cmake | 9 +++++++++ Tests/RunCMake/file/RunCMakeTest.cmake | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt create mode 100644 Tests/RunCMake/file/CREATE_LINK-noexist.cmake create mode 100644 Tests/RunCMake/file/CREATE_LINK.cmake diff --git a/Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt b/Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt new file mode 100644 index 0000000..97eee4f --- /dev/null +++ b/Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt @@ -0,0 +1 @@ +Hard link error: Cannot hard link 'does_not_exist.txt' as it does not exist. diff --git a/Tests/RunCMake/file/CREATE_LINK-noexist.cmake b/Tests/RunCMake/file/CREATE_LINK-noexist.cmake new file mode 100644 index 0000000..1c4dc12 --- /dev/null +++ b/Tests/RunCMake/file/CREATE_LINK-noexist.cmake @@ -0,0 +1,9 @@ +file(CREATE_LINK does_not_exist.txt TestLink.txt RESULT result) +if(NOT result STREQUAL "0") + message("Hard link error: ${result}") +endif() + +file(CREATE_LINK does_not_exist.txt TestSymLink.txt RESULT sym_result SYMBOLIC) +if(NOT sym_result STREQUAL "0") + message("Symlink fail: ${sym_result}") +endif() diff --git a/Tests/RunCMake/file/CREATE_LINK.cmake b/Tests/RunCMake/file/CREATE_LINK.cmake new file mode 100644 index 0000000..1d65b69 --- /dev/null +++ b/Tests/RunCMake/file/CREATE_LINK.cmake @@ -0,0 +1,9 @@ +file(CREATE_LINK ${CMAKE_CURRENT_LIST_FILE} TestLink.cmake RESULT result) +if(NOT result STREQUAL "0") + message(SEND_ERROR "Hard link result='${result}'") +endif() + +file(CREATE_LINK ${CMAKE_CURRENT_LIST_FILE} TestSymLink.cmake RESULT sym_result SYMBOLIC) +if(NOT sym_result STREQUAL "0") + message(SEND_ERROR "Symlink result='${sym_result}'") +endif() diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index b872824..0962c17 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -1,5 +1,7 @@ include(RunCMake) +run_cmake(CREATE_LINK) +run_cmake(CREATE_LINK-noexist) run_cmake(DOWNLOAD-hash-mismatch) run_cmake(DOWNLOAD-unused-argument) run_cmake(DOWNLOAD-httpheader-not-set) -- cgit v0.12