summaryrefslogtreecommitdiff
path: root/modules/futimens-tests
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-12 10:42:35 -0600
committerEric Blake <ebb9@byu.net>2009-10-16 08:21:24 -0600
commit4d8f229535aef794199fa6dd0eb29e852c35d73d (patch)
treec77ab524f57e8693d32a0e080d77d671d51d0b69 /modules/futimens-tests
parent8cb4edaac4154d3b4455b9d132599bf73c0100ee (diff)
downloadgnulib-4d8f229535aef794199fa6dd0eb29e852c35d73d.tar.gz
test-stat-time, test-utimens: improve portability
ext4 on an alpha system has a quantization of about 10 ms but a resolution of 1ns; utimecmp does not know about quantization, so tests were failing when comparing timestamps that fall within the same quantization window. Add strategic usleeps throughout to minimize this issue, whether or not we later improve utimecmp to account for quantization. Windows (and hence cygwin) is documented as having a default clock quantization of 15.25 milliseconds (although it can be reduced to 1 millisecond); file timestamps are quantized to this boundary even though more accurate timing can be obtained. However, this means that 15 milliseconds is too short for any test that wants to guarantee crossing a file timestamp boundary. Cygwin, however, still has bugs where clock_gettime can lag behind file timestamps, which is not fixed by this patch. Solaris 9 with NFS exposed the same problem for futimes that was previously fixed for utimes on Solaris 8, where futimens(f,NULL) uses a different time source than futimes(,{,UTIME_NOW}). * tests/test-stat-time.c (nap): Lengthen delay to 20ms, for ext4 on alpha, and for cygwin. * tests/test-utimens-common.h: New file. (nap): Factor delays into single function. * tests/test-lutimens.h (test_lutimens): Use new header. * tests/test-futimens.h (test_futimens): Likewise. * tests/test-utimens.h (test_utimens): Likewise. Also, force NFS timestamps to occur from same machine, as was done previously for test_utimens. * modules/utimens-tests (Files): Ship new file. * modules/futimens-tests (Files): Likewise. Reported in part by Jim Meyering. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'modules/futimens-tests')
-rw-r--r--modules/futimens-tests1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/futimens-tests b/modules/futimens-tests
index 50756da1f5..3a92524f14 100644
--- a/modules/futimens-tests
+++ b/modules/futimens-tests
@@ -1,5 +1,6 @@
Files:
tests/test-futimens.h
+tests/test-utimens-common.h
tests/test-futimens.c
Depends-on: