From d1513e0f0b1758c37fd4d1430c7a78409b2b4a04 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 9 Nov 2009 12:48:31 -0500 Subject: [PATCH] Allow test to work on machines with umasks that do not allow files to be overwritten. --- Tests/TarTest/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt index 548712d88..a3c5b31ff 100644 --- a/Tests/TarTest/CMakeLists.txt +++ b/Tests/TarTest/CMakeLists.txt @@ -28,9 +28,19 @@ IF(UNIX) SET(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") ENDIF(UNIX) +# cleanup first in case there are files left from previous runs +# if the umask is odd on the machine it might create files that +# are not automatically over written. These tests are run +# each time the configure step is run. +FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") +FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") +FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") +FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") + MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") + # Run tests EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\" tar_dir") EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\" tar_dir")