tests: fix a timestamp race in python tests
authorAdam Sampson <ats@offog.org>
Thu, 16 Aug 2012 16:54:41 +0000 (18:54 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 16 Aug 2012 16:54:57 +0000 (18:54 +0200)
Fixes automake bug#12210.

* t/python-missing.sh: Call aclocal and autoconf with the "--force"
option.  We need this because, on fast machines, it's possible for
'mypy.m4' and 'aclocal.m4' to end up with the same timestamp as configure,
so autoconf (without the "--force" options) wouldn't bother to rebuild it,
and would just rerun the previous AM_PATH_PYTHON test, succeeding rather
than failing as expected.
* t/python-am-path-iftrue.sh: Likewise.

Co-authored-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/python-am-path-iftrue.sh
t/python-missing.sh

index 3c5201f..d7ba436 100755 (executable)
@@ -45,8 +45,10 @@ cat > mypy.m4 << 'END'
 AM_PATH_PYTHON([0.0], [$PYTHON -c 'print("%u:%u" % (1-1, 2**0))' > py.out])
 END
 
-$ACLOCAL
-$AUTOCONF
+# The "--force" option here is truly needed to avoid potential timestamp
+# races.  See automake bug#12210.
+$ACLOCAL --force
+$AUTOCONF --force
 ./configure
 test x"$(cat py.out)" = x0:1
 
index c88a4f9..b0912d3 100755 (executable)
@@ -58,8 +58,10 @@ rm -rf autom4te*.cache # Will have to re-run aclocal.
 
 # Hopefully the Python team will never release such a version :-)
 echo 'AM_PATH_PYTHON([9999.9], [])' > mypy.m4
-$ACLOCAL
-$AUTOCONF
+# The "--force" options (here and below) are truly needed to avoid
+# potential timestamp races.  See automake bug#12210.
+$ACLOCAL --force
+$AUTOCONF --force
 ./configure >stdout 2>stderr && {
   cat stdout
   cat stderr >&2