]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Make ‘forbidden tokens, basic’ test more robust.
authorZack Weinberg <zackw@panix.com>
Thu, 5 Nov 2020 15:24:08 +0000 (10:24 -0500)
committerZack Weinberg <zackw@panix.com>
Thu, 5 Nov 2020 15:24:08 +0000 (10:24 -0500)
While testing the previous patch I noticed that the ‘forbidden tokens,
basic’ test can fail if it runs too fast, because the autom4te cache
files aren’t considered newer than configure.ac.

* tests/tools.at (forbidden tokens, basic): Add delays to ensure
  autom4te.cache files are newer than configure.ac.

tests/tools.at

index ba443816ee1ab7c538e6a998e5ad098816e604d6..967d9be1e923d8d4cd7210737880cbd8e51cd1a0 100644 (file)
@@ -450,7 +450,7 @@ _AS_BAR
 [dnl]
 ]])
 
-dnl This test needs autom4te's cache, in spite of any ~/.autom4te.cfg.
+# This test needs autom4te's cache, in spite of any ~/.autom4te.cfg.
 AT_DATA([.autom4te.cfg], [[
 begin-language: "Autoconf"
 args: --cache=autom4te.cache
@@ -460,6 +460,10 @@ args: --cache=autom4te.cache
 end-language: "Autoconf-without-aclocal-m4"
 ]])
 
+# Delay to make sure the cache files generated by the next command are
+# considered newer than configure.ac.
+sleep 2
+
 AT_CHECK_AUTOCONF([], 1, [],
 [[trailer.m4: warning: AC_INIT was never used
 trailer.m4: warning: AC_OUTPUT was never used
@@ -471,6 +475,11 @@ configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
 configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
 configure.ac:6: error: possibly undefined macro: d@&t@nl
 ]])
+
+# Delay to make sure the cache files generated by the previous command
+# are considered to have been created in the past.
+sleep 2
+
 # A second run (without --force) should succeed and yield only the
 # warnings about AC_INIT and AC_OUTPUT.
 AT_CHECK_M4([autoconf], 0, [],