summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-11-09 17:48:31 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-11-09 17:48:31 (GMT)
commitd1513e0f0b1758c37fd4d1430c7a78409b2b4a04 (patch)
treeb5de9ae7f6a0956b04f36829ba3ca7778015bf98
parent8658fcbe24b96aa58deb6b1c498fe8229c486707 (diff)
downloadCMake-d1513e0f0b1758c37fd4d1430c7a78409b2b4a04.zip
CMake-d1513e0f0b1758c37fd4d1430c7a78409b2b4a04.tar.gz
CMake-d1513e0f0b1758c37fd4d1430c7a78409b2b4a04.tar.bz2
Allow test to work on machines with umasks that do not allow files to be overwritten.
-rw-r--r--Tests/TarTest/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt
index 548712d..a3c5b31 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")