From 8302608a744c3a4df3495f8db88784fb3f04660f Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Nov 2011 11:26:10 -0500 Subject: [PATCH] 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. --- Tests/CMakeTests/.gitattributes | 1 + Tests/CMakeTests/File-HASH-Input.txt | 1 + Tests/CMakeTests/File-MD5-BadArg2.cmake | 2 +- Tests/CMakeTests/File-MD5-BadArg4.cmake | 2 +- Tests/CMakeTests/File-MD5-Works.cmake | 2 +- Tests/CMakeTests/File-SHA1-Works.cmake | 2 +- Tests/CMakeTests/File-SHA224-Works.cmake | 2 +- Tests/CMakeTests/File-SHA256-Works.cmake | 2 +- Tests/CMakeTests/File-SHA384-Works.cmake | 2 +- Tests/CMakeTests/File-SHA512-Works.cmake | 2 +- Tests/CMakeTests/FileTest.cmake.in | 12 ++++++------ 11 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 Tests/CMakeTests/.gitattributes create mode 100644 Tests/CMakeTests/File-HASH-Input.txt diff --git a/Tests/CMakeTests/.gitattributes b/Tests/CMakeTests/.gitattributes new file mode 100644 index 000000000..c34e350e5 --- /dev/null +++ b/Tests/CMakeTests/.gitattributes @@ -0,0 +1 @@ +File-HASH-Input.txt crlf=input diff --git a/Tests/CMakeTests/File-HASH-Input.txt b/Tests/CMakeTests/File-HASH-Input.txt new file mode 100644 index 000000000..a1d315b2d --- /dev/null +++ b/Tests/CMakeTests/File-HASH-Input.txt @@ -0,0 +1 @@ +sample input string diff --git a/Tests/CMakeTests/File-MD5-BadArg2.cmake b/Tests/CMakeTests/File-MD5-BadArg2.cmake index 68a172fef..2acc0757e 100644 --- a/Tests/CMakeTests/File-MD5-BadArg2.cmake +++ b/Tests/CMakeTests/File-MD5-BadArg2.cmake @@ -1 +1 @@ -file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-Copy-NoDest.cmake) +file(MD5 ${CMAKE_CURRENT_LIST_DIR}/File-HASH-Input.txt) diff --git a/Tests/CMakeTests/File-MD5-BadArg4.cmake b/Tests/CMakeTests/File-MD5-BadArg4.cmake index a11efcb60..79b27558d 100644 --- a/Tests/CMakeTests/File-MD5-BadArg4.cmake +++ b/Tests/CMakeTests/File-MD5-BadArg4.cmake @@ -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) diff --git a/Tests/CMakeTests/File-MD5-Works.cmake b/Tests/CMakeTests/File-MD5-Works.cmake index 2989e98c5..0fabe54a4 100644 --- a/Tests/CMakeTests/File-MD5-Works.cmake +++ b/Tests/CMakeTests/File-MD5-Works.cmake @@ -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}") diff --git a/Tests/CMakeTests/File-SHA1-Works.cmake b/Tests/CMakeTests/File-SHA1-Works.cmake index 03ea3ac21..f2ab5d747 100644 --- a/Tests/CMakeTests/File-SHA1-Works.cmake +++ b/Tests/CMakeTests/File-SHA1-Works.cmake @@ -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}") diff --git a/Tests/CMakeTests/File-SHA224-Works.cmake b/Tests/CMakeTests/File-SHA224-Works.cmake index 0295346bc..3e86b172f 100644 --- a/Tests/CMakeTests/File-SHA224-Works.cmake +++ b/Tests/CMakeTests/File-SHA224-Works.cmake @@ -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}") diff --git a/Tests/CMakeTests/File-SHA256-Works.cmake b/Tests/CMakeTests/File-SHA256-Works.cmake index 32bc9fe5a..b72d89e95 100644 --- a/Tests/CMakeTests/File-SHA256-Works.cmake +++ b/Tests/CMakeTests/File-SHA256-Works.cmake @@ -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}") diff --git a/Tests/CMakeTests/File-SHA384-Works.cmake b/Tests/CMakeTests/File-SHA384-Works.cmake index 5c56de277..0eeca33cb 100644 --- a/Tests/CMakeTests/File-SHA384-Works.cmake +++ b/Tests/CMakeTests/File-SHA384-Works.cmake @@ -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}") diff --git a/Tests/CMakeTests/File-SHA512-Works.cmake b/Tests/CMakeTests/File-SHA512-Works.cmake index cf107066f..d74ee4429 100644 --- a/Tests/CMakeTests/File-SHA512-Works.cmake +++ b/Tests/CMakeTests/File-SHA512-Works.cmake @@ -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}") diff --git a/Tests/CMakeTests/FileTest.cmake.in b/Tests/CMakeTests/FileTest.cmake.in index 824aba760..3c3d85ddc 100644 --- a/Tests/CMakeTests/FileTest.cmake.in +++ b/Tests/CMakeTests/FileTest.cmake.in @@ -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-STDERR "file MD5 requires a file name and output variable") set(MD5-Works-RESULT 0) -set(MD5-Works-STDERR "a28a44fb5b58a6acf0cbec46557bc775") +set(MD5-Works-STDERR "10d20ddb981a6202b84aa1ce1cb7fce3") set(SHA1-Works-RESULT 0) -set(SHA1-Works-STDERR "e0ce452a7e34e9c705b46e4e7c9cd959082c0777") +set(SHA1-Works-STDERR "83f093e04289b21a9415f408ad50be8b57ad2f34") set(SHA224-Works-RESULT 0) -set(SHA224-Works-STDERR "d1f1c9db3df73586a5a200014505ef03b70da5e0539eb35c11b4ef6f") +set(SHA224-Works-STDERR "e995a7789922c4ef9279d94e763c8375934180a51baa7147bc48edf7") set(SHA256-Works-RESULT 0) -set(SHA256-Works-STDERR "bb38de1c34713f750a4f84404ef5fb1efb93cf815cb09182db457ba91de19195") +set(SHA256-Works-STDERR "d1c5915d8b71150726a1eef75a29ec6bea8fd1bef6b7299ef8048760b0402025") set(SHA384-Works-RESULT 0) -set(SHA384-Works-STDERR "2f01d58436bd04a40ec2c938a15f2bb661bf1bf1560a5f2d40a3ebbb716a58e400ab2992c23ba19fa96dc519e0042c26") +set(SHA384-Works-STDERR "1de9560b4e030e02051ea408200ffc55d70c97ac64ebf822461a5c786f495c36df43259b14483bc8d364f0106f4971ee") set(SHA512-Works-RESULT 0) -set(SHA512-Works-STDERR "349d02e347ddb133afb4557c9e541163f54b6eaa9eb345672bfd7bbce90c9872bf1fad9c6662248eb7b092aef719e4b8c3b8bb1cf47f287abbde12360c073686") +set(SHA512-Works-STDERR "3982a1b4e651768bec70ab1fb97045cb7a659f4ba7203d501c52ab2e803071f9d5fd272022df15f27727fc67f8cd022e710e29010b2a9c0b467c111e2f6abf51") include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") check_cmake_test(File