summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2020-11-05 10:24:08 -0500
committerZack Weinberg <zackw@panix.com>2020-11-05 10:24:08 -0500
commit8e5401395857f1acae558a5e926bad6609580fae (patch)
treef43b4517c3d4ed78947c803106e48cc29368f381
parent0f7e5a5477f97b8a105d563bc7590ebefaff854d (diff)
downloadautoconf-8e5401395857f1acae558a5e926bad6609580fae.tar.gz
Make ‘forbidden tokens, basic’ test more robust.
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.
-rw-r--r--tests/tools.at11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/tools.at b/tests/tools.at
index ba443816..967d9be1 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -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, [],