mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-15 07:18:29 -04:00
scripts/gzip_tests.sh: work around broken timestamps in Travis CI
This commit is contained in:
parent
b6f9462708
commit
455e9c2c3e
@ -93,6 +93,9 @@ assert_equals() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Get the filesystem type.
|
||||
FSTYPE=$(df -T . | tail -1 | awk '{print $2}')
|
||||
|
||||
begin_test 'Basic compression and decompression works'
|
||||
cp file orig
|
||||
gzip file
|
||||
@ -393,12 +396,20 @@ assert_error '\<invalid suffix\>' gunzip -S '""' file
|
||||
|
||||
|
||||
begin_test 'Timestamps and mode are preserved'
|
||||
if [ "$FSTYPE" = shiftfs ]; then
|
||||
# In Travis CI, the filesystem (shiftfs) only supports seconds precision
|
||||
# timestamps. Nanosecond precision still sometimes seems to work,
|
||||
# probably due to caching, but it is unreliable.
|
||||
format='%a;%X;%Y'
|
||||
else
|
||||
format='%a;%x;%y'
|
||||
fi
|
||||
chmod 777 file
|
||||
orig_stat="$(stat -c '%a;%x;%y' file)"
|
||||
orig_stat="$(stat -c "$format" file)"
|
||||
gzip file
|
||||
sleep 1
|
||||
gunzip file.gz
|
||||
assert_equals "$orig_stat" "$(stat -c '%a;%x;%y' file)"
|
||||
assert_equals "$orig_stat" "$(stat -c "$format" file)"
|
||||
|
||||
|
||||
begin_test 'Decompressing multi-member gzip file'
|
||||
|
Loading…
x
Reference in New Issue
Block a user