Fix CMake.File hash test for CRLF checkouts

Use a dedicated test input file for the file() hash API tests.
Set attribute crlf=input so it is always checked out correctly.
This commit is contained in:
Brad King 2011-11-16 11:26:10 -05:00
parent 9fb1a9cf1d
commit 8302608a74
11 changed files with 16 additions and 14 deletions

1
Tests/CMakeTests/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
File-HASH-Input.txt crlf=input

View File

@ -0,0 +1 @@
sample input string

View File

@ -1 +1 @@
file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake) file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt)

View File

@ -1 +1 @@
file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake md5 extra_arg) file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt md5 extra_arg)

View File

@ -1,2 +1,2 @@
file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake md5) file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt md5)
message("${md5}") message("${md5}")

View File

@ -1,2 +1,2 @@
file(SHA1 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake sha1) file(SHA1 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt sha1)
message("${sha1}") message("${sha1}")

View File

@ -1,2 +1,2 @@
file(SHA224 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake sha224) file(SHA224 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt sha224)
message("${sha224}") message("${sha224}")

View File

@ -1,2 +1,2 @@
file(SHA256 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake sha256) file(SHA256 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt sha256)
message("${sha256}") message("${sha256}")

View File

@ -1,2 +1,2 @@
file(SHA384 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake sha384) file(SHA384 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt sha384)
message("${sha384}") message("${sha384}")

View File

@ -1,2 +1,2 @@
file(SHA512 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake sha512) file(SHA512 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt sha512)
message("${sha512}") message("${sha512}")

View File

@ -21,17 +21,17 @@ set(MD5-BadArg2-STDERR "file MD5 requires a file name and output variable")
set(MD5-BadArg4-RESULT 1) set(MD5-BadArg4-RESULT 1)
set(MD5-BadArg4-STDERR "file MD5 requires a file name and output variable") set(MD5-BadArg4-STDERR "file MD5 requires a file name and output variable")
set(MD5-Works-RESULT 0) set(MD5-Works-RESULT 0)
set(MD5-Works-STDERR "a28a44fb5b58a6acf0cbec46557bc775") set(MD5-Works-STDERR "10d20ddb981a6202b84aa1ce1cb7fce3")
set(SHA1-Works-RESULT 0) set(SHA1-Works-RESULT 0)
set(SHA1-Works-STDERR "e0ce452a7e34e9c705b46e4e7c9cd959082c0777") set(SHA1-Works-STDERR "83f093e04289b21a9415f408ad50be8b57ad2f34")
set(SHA224-Works-RESULT 0) set(SHA224-Works-RESULT 0)
set(SHA224-Works-STDERR "d1f1c9db3df73586a5a200014505ef03b70da5e0539eb35c11b4ef6f") set(SHA224-Works-STDERR "e995a7789922c4ef9279d94e763c8375934180a51baa7147bc48edf7")
set(SHA256-Works-RESULT 0) set(SHA256-Works-RESULT 0)
set(SHA256-Works-STDERR "bb38de1c34713f750a4f84404ef5fb1efb93cf815cb09182db457ba91de19195") set(SHA256-Works-STDERR "d1c5915d8b71150726a1eef75a29ec6bea8fd1bef6b7299ef8048760b0402025")
set(SHA384-Works-RESULT 0) set(SHA384-Works-RESULT 0)
set(SHA384-Works-STDERR "2f01d58436bd04a40ec2c938a15f2bb661bf1bf1560a5f2d40a3ebbb716a58e400ab2992c23ba19fa96dc519e0042c26") set(SHA384-Works-STDERR "1de9560b4e030e02051ea408200ffc55d70c97ac64ebf822461a5c786f495c36df43259b14483bc8d364f0106f4971ee")
set(SHA512-Works-RESULT 0) set(SHA512-Works-RESULT 0)
set(SHA512-Works-STDERR "349d02e347ddb133afb4557c9e541163f54b6eaa9eb345672bfd7bbce90c9872bf1fad9c6662248eb7b092aef719e4b8c3b8bb1cf47f287abbde12360c073686") set(SHA512-Works-STDERR "3982a1b4e651768bec70ab1fb97045cb7a659f4ba7203d501c52ab2e803071f9d5fd272022df15f27727fc67f8cd022e710e29010b2a9c0b467c111e2f6abf51")
include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
check_cmake_test(File check_cmake_test(File