From b93f008bb060439615e2acd3d3a872a5d066cc17 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 10 Jan 2003 19:30:16 +0000 Subject: [PATCH] * 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. --- ChangeLog | 9 +++++++++ Makefile.am | 8 ++++---- Makefile.in | 6 +++--- tests/asm.test | 4 ++-- tests/confsub.test | 4 ++-- tests/defs.in | 6 ++++++ tests/lisp3.test | 2 +- tests/texinfo16.test | 4 ++-- tests/warnopts.test | 4 ++-- tests/yaccvpath.test | 6 +++--- 10 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94abffe2..fc702e2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2003-01-10 Alexandre Duret-Lutz + * 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. + * Makefile.am (maintainer-check): Do not require SHELL=/bin/sh after $MAKE -e. * tests/ansi3.test, tests/ansi5.test, tests/cond22.test, diff --git a/Makefile.am b/Makefile.am index 8efc2ded..a0925b19 100644 --- a/Makefile.am +++ b/Makefile.am @@ -228,15 +228,15 @@ maintainer-check: automake aclocal 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 \ diff --git a/Makefile.in b/Makefile.in index 9ec14ce0..3e4736e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -804,12 +804,12 @@ maintainer-check: automake aclocal echo 'the above lines.' 1>&2; \ exit 1; \ fi - @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 @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 \ diff --git a/tests/asm.test b/tests/asm.test index 28adbc68..6802fc28 100755 --- a/tests/asm.test +++ b/tests/asm.test @@ -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 @@ grep AM_PROG_AS stderr # 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 diff --git a/tests/confsub.test b/tests/confsub.test index f9fdb559..d661c1ee 100755 --- a/tests/confsub.test +++ b/tests/confsub.test @@ -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 @@ $AUTOCONF || exit 1 ./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 diff --git a/tests/defs.in b/tests/defs.in index 35d42d2b..93bc32e1 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -244,6 +244,12 @@ export AUTOMAKE ACLOCAL 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 diff --git a/tests/lisp3.test b/tests/lisp3.test index 46e698df..20c52810 100755 --- a/tests/lisp3.test +++ b/tests/lisp3.test @@ -63,7 +63,7 @@ test -f am-one.elc # 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 diff --git a/tests/texinfo16.test b/tests/texinfo16.test index 93351b32..a3fe2653 100755 --- a/tests/texinfo16.test +++ b/tests/texinfo16.test @@ -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 @@ test -f main.info # 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 diff --git a/tests/warnopts.test b/tests/warnopts.test index f222280f..d33b801e 100755 --- a/tests/warnopts.test +++ b/tests/warnopts.test @@ -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 @@ test `wc -l < stderr` = 2 # 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 diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test index be96ac46..75f796f6 100755 --- a/tests/yaccvpath.test +++ b/tests/yaccvpath.test @@ -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 @@ cd sub # 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 @@ grep fubar foo-0.1/parse.c # 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' -- 2.43.5