diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-03-21 14:50:07 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-21 14:50:38 (GMT) |
commit | fac093802a85cad720efe9e42957014b3b5c5561 (patch) | |
tree | 88e80bdb596deb06889989c799a4a17524fc06f3 /Tests | |
parent | e09c606eb47c13bd435892625943e95bb9452996 (diff) | |
parent | ea9a2c175929f8276ef80ee85f81675fccd9c757 (diff) | |
download | CMake-fac093802a85cad720efe9e42957014b3b5c5561.zip CMake-fac093802a85cad720efe9e42957014b3b5c5561.tar.gz CMake-fac093802a85cad720efe9e42957014b3b5c5561.tar.bz2 |
Merge topic 'tar-improve-error-handling'
ea9a2c1759 cmake: tar: Parse 'cmake -E tar' arguments
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3081
Diffstat (limited to 'Tests')
6 files changed, 24 insertions, 19 deletions
diff --git a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake index c8a3de9..5deb110 100644 --- a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake @@ -4,21 +4,23 @@ 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) -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" ${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) +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) +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(bad-without-action tar f bad.tar ${CMAKE_CURRENT_LIST_DIR}/test-file.txt) +external_command_test(bad-wrong-flag tar cvfq bad.tar ${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" ${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-without-action-result.txt b/Tests/RunCMake/CommandLineTar/bad-without-action-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/bad-without-action-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLineTar/bad-without-action-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-without-action-stderr.txt new file mode 100644 index 0000000..2fec254 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/bad-without-action-stderr.txt @@ -0,0 +1 @@ +^CMake Error: tar: No action specified. Please choose: 't' \(list\), 'c' \(create\) or 'x' \(extract\)$ diff --git a/Tests/RunCMake/CommandLineTar/bad-wrong-flag-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-wrong-flag-stderr.txt new file mode 100644 index 0000000..d5c1e01 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/bad-wrong-flag-stderr.txt @@ -0,0 +1 @@ +^tar: Unknown argument: q diff --git a/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake index 5f2674a..53ee961 100644 --- a/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake +++ b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake @@ -1,9 +1,9 @@ set(OUTPUT_NAME "test.tar.gz") -set(COMPRESSION_FLAGS cvzf) +set(COMPRESSION_FLAGS -cvzf) set(COMPRESSION_OPTIONS --format=gnutar) -set(DECOMPRESSION_FLAGS xvzf) +set(DECOMPRESSION_FLAGS -xvzf) include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) diff --git a/Tests/RunCMake/CommandLineTar/pax.cmake b/Tests/RunCMake/CommandLineTar/pax.cmake index 60ed238..77f74d1 100644 --- a/Tests/RunCMake/CommandLineTar/pax.cmake +++ b/Tests/RunCMake/CommandLineTar/pax.cmake @@ -1,9 +1,9 @@ set(OUTPUT_NAME "test.tar") -set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_FLAGS -cvf) set(COMPRESSION_OPTIONS --format=pax) -set(DECOMPRESSION_FLAGS xvf) +set(DECOMPRESSION_FLAGS -xvf) include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) |