Raymond Toy pushed to branch master at cmucl / cmucl Commits: 07be52cc by Raymond Toy at 2025-10-23T16:30:34-07:00 Fix #449: touch 64-bit-timestamp.txt with desired time - - - - - 443a77eb by Raymond Toy at 2025-10-23T16:30:34-07:00 Merge branch 'issue-449-set-timestamp-on-test-file' into 'master' Fix #449: touch 64-bit-timestamp.txt with desired time Closes #449 See merge request cmucl/cmucl!328 - - - - - 5 changed files: - .gitlab-ci.yml - bin/run-unit-tests.sh - tests/os.lisp - tests/resources/64-bit-timestamp.txt → tests/resources/64-bit-timestamp-2038.txt - + tests/resources/64-bit-timestamp-2106.txt Changes: ===================================== .gitlab-ci.yml ===================================== @@ -7,7 +7,7 @@ variables: download_url: "https://common-lisp.net/project/cmucl/downloads/release/$release" version: "$release-x86" tar_ext: "xz" - bootstrap: "-B boot-21f" + bootstrap: "" # Default install configuration to download the cmucl tarballs to use # for building. ===================================== bin/run-unit-tests.sh ===================================== @@ -42,6 +42,14 @@ rm -rf test-tmp mkdir test-tmp ln -s /bin/ls test-tmp/ls-link +# Set the timestamps on 64-bit-timestamp-2038.txt and +# 64-bit-timestamp-2106.txt. The time for the first file is a +# negative value for a 32-bit time_t. The second file won't fit in a +# 32-bit time_t value. It's ok if this doesn't work in general, as +# long as it works on Linux for the stat test in tests/os.lisp. +touch -d "1 April 2038" tests/resources/64-bit-timestamp-2038.txt +touch -d "1 April 2106" tests/resources/64-bit-timestamp-2106.txt + # Cleanup temp files and directories that we created during testing. function cleanup { rm -f /tmp/trac.36.bom.txt /tmp/trac.43.txt ===================================== tests/os.lisp ===================================== @@ -36,9 +36,24 @@ (assert-eql status 0))) #+linux -(define-test stat.64-bit-timestamp +(define-test stat.64-bit-timestamp-2038 (:tag :issues) - (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp.txt" + (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp-2038.txt" + cl:*load-pathname*))) + (assert-true (probe-file test-file)) + (multiple-value-bind (ok st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size + st-atime st-mtime + st-ctime st-blksize st-blocks) + (unix:unix-stat (namestring test-file)) + (declare (ignore st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size + st-ctime st-blksize st-blocks)) + (assert-true ok) + (assert-equal 2153718000 st-atime) + (assert-equal 2153718000 st-mtime)))) + +(define-test stat.64-bit-timestamp-2106 + (:tag :issues) + (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp-2106.txt" cl:*load-pathname*))) (assert-true (probe-file test-file)) (multiple-value-bind (ok st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size @@ -48,5 +63,5 @@ (declare (ignore st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-ctime st-blksize st-blocks)) (assert-true ok) - (assert-equal st-atime 2153718000) - (assert-equal st-mtime 2153718000)))) + (assert-equal 4299548400 st-atime) + (assert-equal 4299548400 st-mtime)))) ===================================== tests/resources/64-bit-timestamp.txt → tests/resources/64-bit-timestamp-2038.txt ===================================== ===================================== tests/resources/64-bit-timestamp-2106.txt ===================================== View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/52ce44f1f04551f323eb1bc... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/52ce44f1f04551f323eb1bc... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)