From 8e5401395857f1acae558a5e926bad6609580fae Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Thu, 5 Nov 2020 10:24:08 -0500 Subject: =?UTF-8?q?Make=20=E2=80=98forbidden=20tokens,=20basic=E2=80=99=20?= =?UTF-8?q?test=20more=20robust.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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, [], -- cgit v1.2.1