diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-03-19 17:37:48 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-19 17:37:59 (GMT) |
commit | f1e53266e9ce7e8a9568bde23f865136be958887 (patch) | |
tree | bb036d8514e430f4d6df415c73b7664dbcd5aab9 /Tests | |
parent | d2101e944a03056dc2180dd790ba85175e04d653 (diff) | |
parent | 8634576dcb03087fc507b8012a47f1ecc852f65f (diff) | |
download | CMake-f1e53266e9ce7e8a9568bde23f865136be958887.zip CMake-f1e53266e9ce7e8a9568bde23f865136be958887.tar.gz CMake-f1e53266e9ce7e8a9568bde23f865136be958887.tar.bz2 |
Merge topic 'improve-tar-command'
8634576dcb cmake: Don't interrupt archive creation if unable to read a file.
c7c6a4a2cc Help: Update 'tar' documentation with supported arguments
7c47fd8cd1 cmake: tar: Display warning when no files provided during archive creation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3080
Diffstat (limited to 'Tests')
9 files changed, 14 insertions, 7 deletions
diff --git a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake index 12635db..c8a3de9 100644 --- a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake @@ -4,6 +4,7 @@ function(external_command_test NAME) run_cmake_command(${NAME} ${CMAKE_COMMAND} -E ${ARGN}) endfunction() +external_command_test(without-files tar cvf bad.tar) external_command_test(bad-opt1 tar cvf bad.tar --bad) external_command_test(bad-mtime1 tar cvf bad.tar --mtime=bad .) external_command_test(bad-from1 tar cvf bad.tar --files-from=bad) @@ -11,12 +12,13 @@ external_command_test(bad-from2 tar cvf bad.tar --files-from=.) external_command_test(bad-from3 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from3.txt) external_command_test(bad-from4 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from4.txt) external_command_test(bad-from5 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from5.txt) +external_command_test(bad-file tar cf bad.tar badfile.txt ${CMAKE_CURRENT_LIST_DIR}/test-file.txt) external_command_test(end-opt1 tar cvf bad.tar -- --bad) external_command_test(end-opt2 tar cvf bad.tar --) -external_command_test(mtime tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") -external_command_test(bad-format tar cvf bad.tar "--format=bad-format") -external_command_test(zip-bz2 tar cvjf bad.tar "--format=zip") -external_command_test(7zip-gz tar cvzf bad.tar "--format=7zip") +external_command_test(mtime tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC" ${CMAKE_CURRENT_LIST_DIR}/test-file.txt) +external_command_test(bad-format tar cvf bad.tar "--format=bad-format" ${CMAKE_CURRENT_LIST_DIR}/test-file.txt) +external_command_test(zip-bz2 tar cvjf bad.tar "--format=zip" ${CMAKE_CURRENT_LIST_DIR}/test-file.txt) +external_command_test(7zip-gz tar cvzf bad.tar "--format=7zip" ${CMAKE_CURRENT_LIST_DIR}/test-file.txt) run_cmake(7zip) run_cmake(gnutar) diff --git a/Tests/RunCMake/CommandLineTar/bad-file-result.txt b/Tests/RunCMake/CommandLineTar/bad-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/bad-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLineTar/bad-file-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-file-stderr.txt new file mode 100644 index 0000000..1f9f748 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/bad-file-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Unable to read from file 'badfile.txt': .* +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt index 1417d4d..fb0702a 100644 --- a/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: archive_read_disk_entry_from_file 'does-not-exist':.* +^CMake Error: Unable to read from file 'does-not-exist':.* CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt index 1417d4d..fb0702a 100644 --- a/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: archive_read_disk_entry_from_file 'does-not-exist':.* +^CMake Error: Unable to read from file 'does-not-exist':.* CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt index 1fddf6d..1342dc8 100644 --- a/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: archive_read_disk_entry_from_file '--bad':.* +^CMake Error: Unable to read from file '--bad':.* CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLineTar/end-opt2-stderr.txt b/Tests/RunCMake/CommandLineTar/end-opt2-stderr.txt new file mode 100644 index 0000000..70166f5 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/end-opt2-stderr.txt @@ -0,0 +1 @@ +^tar: No files or directories specified diff --git a/Tests/RunCMake/CommandLineTar/test-file.txt b/Tests/RunCMake/CommandLineTar/test-file.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/test-file.txt diff --git a/Tests/RunCMake/CommandLineTar/without-files-stderr.txt b/Tests/RunCMake/CommandLineTar/without-files-stderr.txt new file mode 100644 index 0000000..70166f5 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/without-files-stderr.txt @@ -0,0 +1 @@ +^tar: No files or directories specified |