summaryrefslogtreecommitdiff
path: root/Tests/CMakeTests/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-05-27 12:21:56 -0400
committerDavid Cole <david.cole@kitware.com>2010-05-27 12:21:56 -0400
commitf67139ae6fdf964218a93e5506722a367e781c6f (patch)
tree2245faa382647a682ed2cfe41bc70331c706247e /Tests/CMakeTests/CMakeLists.txt
parent282a119e355f86e20cc04fabd98083de2799c0ea (diff)
downloadcmake-f67139ae6fdf964218a93e5506722a367e781c6f.tar.gz
Improve FILE(DOWNLOAD) and ExternalProject.
Improve FILE(DOWNLOAD ...): - Add percent complete progress output to the FILE DOWNLOAD command. This progress output is off by default to preserve existing behavior. To turn it on, pass SHOW_PROGRESS as an argument. - Add EXPECTED_MD5 argument. Verify that the downloaded file has the expected md5 sum after download is complete. - Add documentation for SHOW_PROGRESS and EXPECTED_MD5. When the destination file exists already and has the expected md5 sum, then do not bother re-downloading the file. ("Short circuit" return.) Also, add a test that checks for the status output indicating that the short circuit behavior is actually occurring. Use a binary file for the test so that the md5 sum is guaranteed to be the same on all platforms regardless of "shifting text file line ending" issues. Improve ExternalProject: - Add argument URL_MD5. - Add verify step that compares md5 sum of .tar.gz file before extracting it. - Add md5 check to download step, too, to prevent unnecessary downloads. - Emit a warning message when a file is not verified. Indicate that the file may be corrupt or that no checksum was specified.
Diffstat (limited to 'Tests/CMakeTests/CMakeLists.txt')
-rw-r--r--Tests/CMakeTests/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index 7a176e9c61..3e5f08ce18 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -28,6 +28,11 @@ AddCMakeTest(Math "")
AddCMakeTest(CMakeMinimumRequired "")
AddCMakeTest(CompilerIdVendor "")
+AddCMakeTest(FileDownload "")
+set_property(TEST CMake.FileDownload PROPERTY
+ PASS_REGULAR_EXPRESSION "file already exists with expected MD5 sum"
+ )
+
if(HAVE_ELF_H)
AddCMakeTest(ELF "")
endif()