summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLineTar/set-mtime.cmake
diff options
context:
space:
mode:
authorKasper Laudrup <you@example.com>2022-03-13 18:16:25 (GMT)
committerKasper Laudrup <you@example.com>2022-03-23 13:41:34 (GMT)
commitf692cba34b758f5c308c3fd659c438ce022a0a80 (patch)
tree2e6bf24a0b3e90e0d44366fe023d93e1add16ba7 /Tests/RunCMake/CommandLineTar/set-mtime.cmake
parent14d3f2a5c817683712ff78e0bebaa660c84ff0b3 (diff)
downloadCMake-f692cba34b758f5c308c3fd659c438ce022a0a80.zip
CMake-f692cba34b758f5c308c3fd659c438ce022a0a80.tar.gz
CMake-f692cba34b758f5c308c3fd659c438ce022a0a80.tar.bz2
Tests: Add test for 'cmake -E tar --mtime' option
Add a test for ensuring the `--mtime` option works as expected.
Diffstat (limited to 'Tests/RunCMake/CommandLineTar/set-mtime.cmake')
-rw-r--r--Tests/RunCMake/CommandLineTar/set-mtime.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLineTar/set-mtime.cmake b/Tests/RunCMake/CommandLineTar/set-mtime.cmake
new file mode 100644
index 0000000..333cc88
--- /dev/null
+++ b/Tests/RunCMake/CommandLineTar/set-mtime.cmake
@@ -0,0 +1,11 @@
+include(${CMAKE_CURRENT_LIST_DIR}/mtime-tests.cmake)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+foreach(file ${CHECK_FILES})
+ file(TIMESTAMP ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file} MTIME UTC)
+ if(NOT MTIME STREQUAL ARCHIVE_MTIME_RFC3339)
+ message(FATAL_ERROR
+ "Extracted timestamp ${MTIME} does not match expected ${ARCHIVE_MTIME_RFC3339}")
+ endif()
+endforeach()