diff options
author | John Freeman <jfreeman08@gmail.com> | 2019-05-31 21:35:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-03 18:20:00 (GMT) |
commit | 07a80c70020e0e533db8d75d7fe7c4270cc25afb (patch) | |
tree | 71e52d98611f1f1042f976b7cd505f6dd1cf95c2 /Tests/RunCMake | |
parent | 013bee698e8470169d99e90aa86d5d85693c6b12 (diff) | |
download | CMake-07a80c70020e0e533db8d75d7fe7c4270cc25afb.zip CMake-07a80c70020e0e533db8d75d7fe7c4270cc25afb.tar.gz CMake-07a80c70020e0e533db8d75d7fe7c4270cc25afb.tar.bz2 |
cmake: Teach -E remove_directory to remove multiple directories
The `make_directory` command can make multiple directories in a single
invocation. Make `remove_directory` mirror that behavior.
Diffstat (limited to 'Tests/RunCMake')
7 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake new file mode 100644 index 0000000..fd6ea11 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake @@ -0,0 +1,3 @@ +if(IS_DIRECTORY ${out}/parent/child) + set(RunCMake_TEST_FAILED "child directory was not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake new file mode 100644 index 0000000..2b7202a --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake @@ -0,0 +1,6 @@ +if(IS_DIRECTORY ${out}/d1) + set(RunCMake_TEST_FAILED "directory d1 was not removed") +endif() +if(IS_DIRECTORY ${out}/d2) + set(RunCMake_TEST_FAILED "directory d2 was not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake new file mode 100644 index 0000000..0aa4a52 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${outfile}) + set(RunCMake_TEST_FAILED "removed non-directory ${outfile}") +endif() diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 25a6435..6c17a6a 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -332,10 +332,16 @@ file(MAKE_DIRECTORY ${out}) file(WRITE ${outfile} "") run_cmake_command(E_make_directory-three-directories ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${out}/d2) +run_cmake_command(E_remove_directory-three-directories + ${CMAKE_COMMAND} -E remove_directory ${out}/d1 ${out}/d2 ${out}/d2) run_cmake_command(E_make_directory-directory-with-parent ${CMAKE_COMMAND} -E make_directory ${out}/parent/child) +run_cmake_command(E_remove_directory-directory-with-parent + ${CMAKE_COMMAND} -E remove_directory ${out}/parent) run_cmake_command(E_make_directory-two-directories-and-file ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${outfile}) +run_cmake_command(E_remove_directory-two-directories-and-file + ${CMAKE_COMMAND} -E remove_directory ${out}/d1 ${out}/d2 ${outfile}) unset(out) unset(outfile) |