diff options
author | Brad King <brad.king@kitware.com> | 2013-01-24 19:12:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-01-30 15:05:07 (GMT) |
commit | ee2abfdc8913e4e9a5bc77c56a9d3dea83fde6f1 (patch) | |
tree | 4a0235d75ef035f1129888043fda79db892f8f75 /Tests/RunCMake/ExternalData | |
parent | aa8b2288d320335d28f3777e1bc86ed3df231a09 (diff) | |
download | CMake-ee2abfdc8913e4e9a5bc77c56a9d3dea83fde6f1.zip CMake-ee2abfdc8913e4e9a5bc77c56a9d3dea83fde6f1.tar.gz CMake-ee2abfdc8913e4e9a5bc77c56a9d3dea83fde6f1.tar.bz2 |
ExternalData: Add support for SHA 1 and 2 hash algorithms
Update the Module.ExternalData and RunCMake.ExternalData tests to cover
some of them.
Diffstat (limited to 'Tests/RunCMake/ExternalData')
-rw-r--r-- | Tests/RunCMake/ExternalData/LinkContentSHA1-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalData/LinkContentSHA1.cmake | 22 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalData/RunCMakeTest.cmake | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalData/LinkContentSHA1-stdout.txt b/Tests/RunCMake/ExternalData/LinkContentSHA1-stdout.txt new file mode 100644 index 0000000..9a8eb2e --- /dev/null +++ b/Tests/RunCMake/ExternalData/LinkContentSHA1-stdout.txt @@ -0,0 +1,3 @@ +-- Linked ToLink.txt.sha1 to ExternalData SHA1/114ee5dda251457fd2df63bec91d3b8db43aba58 +-- Raw data correctly transformed to content link! +-- Staged content exists! diff --git a/Tests/RunCMake/ExternalData/LinkContentSHA1.cmake b/Tests/RunCMake/ExternalData/LinkContentSHA1.cmake new file mode 100644 index 0000000..f78501c --- /dev/null +++ b/Tests/RunCMake/ExternalData/LinkContentSHA1.cmake @@ -0,0 +1,22 @@ +include(ExternalData) +set(ExternalData_LINK_CONTENT SHA1) +set(ExternalData_SOURCE_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +set(ExternalData_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/ExternalData) +set(input ${CMAKE_CURRENT_BINARY_DIR}/ToLink.txt) +set(output ${CMAKE_CURRENT_BINARY_DIR}/ExternalData/ToLink.txt) +set(staged "${CMAKE_CURRENT_BINARY_DIR}/.ExternalData_SHA1_114ee5dda251457fd2df63bec91d3b8db43aba58") +file(REMOVE ${staged}) +file(REMOVE ${input}.sha1) +file(WRITE ${input} "To be transformed into a content link.") +ExternalData_Expand_Arguments(Data args DATA{${input}}) +if("x${args}" STREQUAL "x${output}") + message(STATUS "Raw data correctly transformed to content link!") +else() + message(FATAL_ERROR "Data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() +if(EXISTS "${staged}") + message(STATUS "Staged content exists!") +else() + message(FATAL_ERROR "Staged content missing!") +endif() diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake index fc85a21..5ee46c9 100644 --- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake @@ -12,6 +12,7 @@ run_cmake(Directory3) run_cmake(Directory4) run_cmake(Directory5) run_cmake(LinkContentMD5) +run_cmake(LinkContentSHA1) run_cmake(MissingData) run_cmake(NoLinkInSource) run_cmake(NoURLTemplates) |