Fix race condition in werror2.test due to sanity sleep change.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 11 Oct 2009 14:58:27 +0000 (16:58 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 11 Oct 2009 14:58:27 +0000 (16:58 +0200)
* tests/werror2.test: Generate Makefile.in before configure so
that a Makefile.am update after configure has run is guaranteed
to be newer than Makefile.in.
* tests/subdir5.test: Document why this test does not need to be
fixed.
* tests/subdir8.test: Likewise.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/subdir5.test
tests/subdir8.test
tests/werror2.test

index a00523b..d17f620 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-10-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Fix race condition in werror2.test due to sanity sleep change.
+       * tests/werror2.test: Generate Makefile.in before configure so
+       that a Makefile.am update after configure has run is guaranteed
+       to be newer than Makefile.in.
+       * tests/subdir5.test: Document why this test does not need to be
+       fixed.
+       * tests/subdir8.test: Likewise.
+
        Improve description of the various *LINK variables.
        * doc/automake.texi (Program and Library Variables): _LINK also
        receives libraries to link against.  _LINK may be generated.
index 1bfee41..2f0113b 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 2009  Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -54,6 +55,12 @@ $AUTOMAKE --include-deps --copy --add-missing
 ./configure
 $MAKE
 
+# We shouldn't need to $sleep here: configure ensures that files
+# generated by it are newer than configure.  Thus, even if
+# Makefile.in is newer than configure but the updated Makefile.am
+# below has the same timestamp as Makefile.in, the latter should
+# be rebuilt due to its dependency on configure.in.
+
 # Now add a new directory.
 cat > configure.in << 'END'
 AC_INIT(maude, 1.0)
index 97f7d42..bc3043e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2009  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -67,6 +67,7 @@ $AUTOMAKE --copy --add-missing
 $MAKE
 
 # Now add a new directory.
+# See subdir5.test for why we shouldn't need to $sleep here.
 
 mkdir sub/maude
 cat > sub/maude/Makefile.am << 'END'
index d55b015..6b6d011 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2009  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,8 +29,11 @@ echo AC_OUTPUT>>configure.in
 : > Makefile.am
 
 $ACLOCAL
-$AUTOCONF
+# Create Makefile.in before configure.  configure ensures files
+# generated by it or later are newer than configure, so this allows
+# us to avoid a $sleep before updating Makefile.am below.
 $AUTOMAKE
+$AUTOCONF
 
 ./configure
 $MAKE