summaryrefslogtreecommitdiff
path: root/Tests/TarTest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/TarTest/CMakeLists.txt')
-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 548712d887..a3c5b31ffe 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")