bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automake 1.7.2 & DJGPP: conftest.test & time delays


From: Alexandre Duret-Lutz
Subject: Re: automake 1.7.2 & DJGPP: conftest.test & time delays
Date: Fri, 10 Jan 2003 20:29:41 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

>>> "Richard" == Richard Dawe <address@hidden> writes:

 Richard> Hello.

 Richard> Windows '95, '98 and ME have some issues with the
 Richard> modification time of files.  This causes the
 Richard> confsub.test to fail, at least on my Windows '98 SE
 Richard> box. The time delay of two seconds isn't long enough
 Richard> between the before and after portions of the
 Richard> test. Five seconds seems OK.

Thanks for the explanations.  Since there was other occurences
of `sleep 2' serving the same purpose, I'm installing the following
patch on HEAD and branch-1-7.

2003-01-10  Alexandre Duret-Lutz  <address@hidden>

        * Makefile.am (maintainer-check): Suggest using $sleep instead of
        sleep 2.
        * tests/defs.in (sleep): New variable.
        * tests/asm.test, tests/confsub.test, tests/lisp3.test,
        tests/texinfo16.test, tests/warnopts.test, tests/yaccvpath.test:
        Use $sleep instead of sleep 2, to work around timestamp
        inconsistencies in Windows.
        Reported by Richard Dawe.

Index: Makefile.am
===================================================================
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.205.2.2
diff -u -r1.205.2.2 Makefile.am
--- Makefile.am 10 Jan 2003 18:17:26 -0000      1.205.2.2
+++ Makefile.am 10 Jan 2003 19:25:25 -0000
@@ -228,15 +228,15 @@
          exit 1; \
        fi
 ## Never use `sleep 1' to create files with different timestamps.
-## Use `sleep 2' instead.  Some filesystems (e.g., Windows') have only
+## Use `$sleep' instead.  Some filesystems (e.g., Windows') have only
 ## a 2sec resolution.
-       @if grep -E '\bsleep +1\b' $(srcdir)/tests/*.test; then \
-         echo 'Do not use "sleep 1" in the above tests.  Use "sleep 2" 
instead.' 1>&2; \
+       @if grep -E '\bsleep +[12345]\b' $(srcdir)/tests/*.test; then \
+         echo 'Do not use "sleep x" in the above tests.  Use "$$sleep" 
instead.' 1>&2; \
          exit 1; \
        fi
 ## fgrep and egrep are not required by POSIX.
        @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
-         echo 'Do not use egrep or fgrep in test cases.  Use $FGREP or 
$EGREP.' 1>&2; \
+         echo 'Do not use egrep or fgrep in test cases.  Use $$FGREP or 
$$EGREP.' 1>&2; \
          exit 1; \
        fi
        @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; 
then \
Index: tests/asm.test
===================================================================
RCS file: /cvs/automake/automake/tests/asm.test,v
retrieving revision 1.9
diff -u -r1.9 asm.test
--- tests/asm.test      8 Sep 2002 13:07:55 -0000       1.9
+++ tests/asm.test      10 Jan 2003 19:25:30 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -48,7 +48,7 @@
 # On fast machines the autom4te.cache created during the above run of
 # $AUTOMAKE is likely to have the same time stamp as the configure.in
 # created below; thus causing traces for the old configure.in to be
-# used.  We could do `sleep 2', but it's faster to erase the
+# used.  We could do `$sleep', but it's faster to erase the
 # directory.  (Erase autom4te*.cache, not autom4te.cache, because some
 # bogus installations of Autoconf use a versioned cache.)
 rm -rf autom4te*.cache
Index: tests/confsub.test
===================================================================
RCS file: /cvs/automake/automake/tests/confsub.test,v
retrieving revision 1.20
diff -u -r1.20 confsub.test
--- tests/confsub.test  8 Sep 2002 13:07:55 -0000       1.20
+++ tests/confsub.test  10 Jan 2003 19:25:31 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
 # Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
@@ -55,7 +55,7 @@
 ./configure || exit 1
 $FGREP 'Before.' subdir/config.h
 
-sleep 2
+$sleep
 echo 'After.' > subdir/config.hin
 $MAKE || exit 1
 $FGREP 'After.' subdir/config.h || exit 1
Index: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.4.2.4
diff -u -r1.4.2.4 defs.in
--- tests/defs.in       5 Jan 2003 22:40:42 -0000       1.4.2.4
+++ tests/defs.in       10 Jan 2003 19:25:31 -0000
@@ -244,6 +244,12 @@
 EGREP='@EGREP@'
 FGREP='@FGREP@'
 
+# On Windows '95, '98 and ME, files modifications have 2-seconds
+# granularity and can be up to 3 seconds in the future w.r.t. the
+# system clock.  When it is important to ensure one file is older
+# than another we wait at least 5 seconds between creations.
+sleep='sleep 5'
+
 # The tests call `make -e' but we do not want $srcdir from the evironment
 # to override the definition from the Makefile.
 testsrcdir=$srcdir
Index: tests/lisp3.test
===================================================================
RCS file: /cvs/automake/automake/tests/lisp3.test,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 lisp3.test
--- tests/lisp3.test    10 Jan 2003 17:19:45 -0000      1.1.2.1
+++ tests/lisp3.test    10 Jan 2003 19:25:32 -0000
@@ -63,7 +63,7 @@
 # Make sure we build all files when any of them change.
 # (We grep a message to make sure the compilation happens.)
 unique=0a3346e2af8a689b85002b53df09142a
-sleep 2
+$sleep
 echo "(message \"$unique\")(provide 'am-three)" > am-three.el
 $MAKE >output 2>&1
 cat output
Index: tests/texinfo16.test
===================================================================
RCS file: /cvs/automake/automake/tests/texinfo16.test,v
retrieving revision 1.4
diff -u -r1.4 texinfo16.test
--- tests/texinfo16.test        17 Sep 2002 17:40:14 -0000      1.4
+++ tests/texinfo16.test        10 Jan 2003 19:25:32 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -62,7 +62,7 @@
 # This is needed to test the "subtle" issue described below.
 test -f stamp-vti
 test -f version.texi
-sleep 2
+$sleep
 touch stamp-vti
 
 $MAKE distclean
Index: tests/warnopts.test
===================================================================
RCS file: /cvs/automake/automake/tests/warnopts.test,v
retrieving revision 1.4
diff -u -r1.4 warnopts.test
--- tests/warnopts.test 19 Sep 2002 19:04:09 -0000      1.4
+++ tests/warnopts.test 10 Jan 2003 19:25:32 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -64,7 +64,7 @@
 # On fast machines the autom4te.cache created during the above run of
 # $AUTOMAKE is likely to have the same time stamp as the configure.in
 # created below; thus causing traces for the old configure.in to be
-# used.  We could do `sleep 2', but it's faster to erase the
+# used.  We could do `$sleep', but it's faster to erase the
 # directory.  (Erase autom4te*.cache, not autom4te.cache, because some
 # bogus installations of Autoconf use a versioned cache.)
 rm -rf autom4te*.cache
Index: tests/yaccvpath.test
===================================================================
RCS file: /cvs/automake/automake/tests/yaccvpath.test,v
retrieving revision 1.13
diff -u -r1.13 yaccvpath.test
--- tests/yaccvpath.test        8 Sep 2002 13:07:56 -0000       1.13
+++ tests/yaccvpath.test        10 Jan 2003 19:25:32 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -72,7 +72,7 @@
 
 # A delay is needed to make sure that the new parse.y is indeed newer
 # than parse.c, i.e. the they don't have the same timestamp.
-sleep 2
+$sleep
 
 # New parser, with `fubar'
 cat > ../parse.y << 'END'
@@ -94,7 +94,7 @@
 
 # A delay is needed to make sure that the new parse.y is indeed newer
 # than parse.c, i.e. the they don't have the same timestamp.
-sleep 2
+$sleep
 
 # New parser, with `maude'
 cat > ../parse.y << 'END'

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]