[Cook] [PATCH] cygwin-specific failure of test t0094

Lev S Bishop lev.bishop at yale.edu
Tue May 3 04:55:16 EST 2005


Test t0094 fails on cygwin systems due to TIMESTAMP_GRANULARITY being set 
to 2 (rather than the usual 1). Here is a patch for this. 

Incidentally, many (many) of the tests contain a 'sleep 2', generally to 
make sure the TIMESTAMP ticks over. Probably they should all be replaced 
by some kind of 'sleep $TIMESTAMPGRANULARITYPLUSONE' in order to be 
valid on cygwin, etc. I haven't, however, had time to look at all the 
different places sleeps appear in the tests, to make these changes. Maybe 
I will sometime in the future if no-one else does.

--- test/00/t0094a.sh   2005-04-22 14:30:04.532249600 -0400
+++ test/00/t0094a.sh   2005-04-23 19:21:39.908579200 -0400
@@ -87,12 +87,29 @@
 $bin/cook -nl > test.out 2>&1
 if test $? -ne 0 ; then cat test.out; fail; fi

+UN_SYSTEM=`(uname -s) 2>/dev/null` ||\
+UN_SYSTEM='unknown'
+case "${UN_SYSTEM}" in
+  # CYGWIN has TIMESTAMP_GRANULARITY 2
+  # Probably need something similar for PRIMOS
+  # which has TIMESTAMP_GRANULARITY 4
+*CYGWIN* )
+cat > test.ok << 'fubar'
+leaf
+       modify Fri, 16 Feb 1996 12:34:56 GMT
+b
+       modify Fri, 16 Feb 1996 12:34:58 GMT
+fubar
+;;
+* )
 cat > test.ok << 'fubar'
 leaf
        modify Fri, 16 Feb 1996 12:34:56 GMT
 b
        modify Fri, 16 Feb 1996 12:34:57 GMT
 fubar
+esac
+
 if test $? -ne 0 ; then fail; fi
 $bin/cooktime -report leaf b > test.out
 if test $? -ne 0 ; then fail; fi






More information about the Cook-users mailing list