diff options
author | Brad King <brad.king@kitware.com> | 2015-01-14 18:22:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-19 19:16:19 (GMT) |
commit | 3a60c899fce77f221cba670b62c90fe2d2daffed (patch) | |
tree | 7d7db3b6820f0766b5ecbdcb411b5d5b07ba6ed7 /Tests/RunCMake/CommandLine | |
parent | 90f9c42732a18e53943c3aa27de76c2511c5a0c6 (diff) | |
download | CMake-3a60c899fce77f221cba670b62c90fe2d2daffed.zip CMake-3a60c899fce77f221cba670b62c90fe2d2daffed.tar.gz CMake-3a60c899fce77f221cba670b62c90fe2d2daffed.tar.bz2 |
cmake: Teach "-E tar" command a "--mtime=" option
Add an option to set the mtime of entries in a tarball so that one can
create a tarball with a consistent content hash (e.g. MD5) for a given
set of files regardless of their current timestamps on disk. This will
be useful for submission of tarballs to CDash, which tracks content
hashes to avoid duplication.
Inspired-by: Bill Hoffman <bill.hoffman@kitware.com>
Diffstat (limited to 'Tests/RunCMake/CommandLine')
7 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt new file mode 100644 index 0000000..ca925f1 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: unable to parse mtime 'bad' +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt new file mode 100644 index 0000000..35133c8 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Unknown option to -E tar: --bad$ diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt new file mode 100644 index 0000000..1fddf6d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: archive_read_disk_entry_from_file '--bad':.* +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 0c43c20..2994f16 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,11 @@ include(RunCMake) +run_cmake_command(E_tar-bad-opt1 ${CMAKE_COMMAND} -E tar cvf bad.tar --bad) +run_cmake_command(E_tar-bad-mtime1 ${CMAKE_COMMAND} -E tar cvf bad.tar --mtime=bad .) +run_cmake_command(E_tar-end-opt1 ${CMAKE_COMMAND} -E tar cvf bad.tar -- --bad) +run_cmake_command(E_tar-end-opt2 ${CMAKE_COMMAND} -E tar cvf bad.tar --) +run_cmake_command(E_tar-mtime ${CMAKE_COMMAND} -E tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") + run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator |