* Makefile.am (maintainer-check): Check for `sleep 1' uses in the
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 7 Apr 2002 21:35:02 +0000 (21:35 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 7 Apr 2002 21:35:02 +0000 (21:35 +0000)
test suite.  Suggest `sleep 2' instead.
* tests/confsub.test: Use `sleep 2'.

ChangeLog
Makefile.am
Makefile.in
tests/confsub.test

index 25532f6..d4b7491 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-07  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * Makefile.am (maintainer-check): Check for `sleep 1' uses in the
+       test suite.  Suggest `sleep 2' instead.
+       * tests/confsub.test: Use `sleep 2'.
+
 2002-04-04  Paul Eggert  <eggert@twinsun.com>
 
        * lib/am/subdirs.am:
index 837cdbc..239c4ac 100644 (file)
@@ -188,6 +188,13 @@ maintainer-check: automake aclocal
          echo 'the above lines.' 1>&2; \
          exit 1; \
        fi
+## Never use `sleep 1' to create files with different timestamps.
+## Use `sleep 2' instead.  Some filesystems (e.g., Windows') have only
+## a 2sec resolution.
+       @if egrep '\bsleep +1\b' $(srcdir)/tests/*.test; then \
+         echo 'Do not use "sleep 1" in the above tests.  Use "sleep 2" instead.' 1>&2; \
+         exit 1; \
+       fi
 
 
 # Tag before making distribution.  Also, don't make a distribution if
index dad2fbd..1696739 100644 (file)
@@ -256,7 +256,7 @@ maintainer-clean-aminfo:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-       @set fnord $(MAKEFLAGS); amf=$$2; \
+       @set fnord $$MAKEFLAGS; amf=$$2; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -276,7 +276,7 @@ $(RECURSIVE_TARGETS):
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-       @set fnord $(MAKEFLAGS); amf=$$2; \
+       @set fnord $$MAKEFLAGS; amf=$$2; \
        dot_seen=no; \
        case "$@" in \
          distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -371,8 +371,10 @@ distdir: $(DISTFILES)
            dir=''; \
          fi; \
          if test -d $$d/$$file; then \
-           cp -pR $$d/$$file $(distdir)$$dir \
-           || exit 1; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
          else \
            test -f $(distdir)/$$file \
            || cp -p $$d/$$file $(distdir)/$$file \
@@ -689,6 +691,10 @@ maintainer-check: automake aclocal
          echo 'the above lines.' 1>&2; \
          exit 1; \
        fi
+       @if egrep '\bsleep +1\b' $(srcdir)/tests/*.test; then \
+         echo 'Do not use "sleep 1" in the above tests.  Use "sleep 2" instead.' 1>&2; \
+         exit 1; \
+       fi
 
 # Tag before making distribution.  Also, don't make a distribution if
 # checks fail.  Also, make sure the NEWS file is up-to-date.
index ed6663b..3007c2d 100755 (executable)
@@ -36,7 +36,7 @@ $AUTOCONF || exit 1
 ./configure || exit 1
 fgrep 'Before.' subdir/config.h
 
-sleep 1
+sleep 2
 echo 'After.' > subdir/config.hin
 $MAKE || exit 1
 fgrep 'After.' subdir/config.h || exit 1