From 9cd8750733369d0399b8b6deac91af8badd9000f Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 24 Jan 2023 22:13:33 -0500 Subject: [PATCH] Avoid "touch" in the testsuite. Some older implementations suffer from timestamp truncation bugs, so the assumption that touching a file sets its mtime to be greater than or equal to previously-created files is not correct. For these test cases, we can just append something to the files instead; the file contents are completely irrelevant. --- tests/options.at | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/options.at b/tests/options.at index 089a87e..820416a 100644 --- a/tests/options.at +++ b/tests/options.at @@ -1,4 +1,4 @@ -dnl Copyright © 2020-2022 Nick Bowler +dnl Copyright © 2020-2023 Nick Bowler dnl License GPLv2+: GNU General Public License version 2 or any later version. dnl This is free software: you are free to change and redistribute it. dnl There is NO WARRANTY, to the extent permitted by law. @@ -286,9 +286,9 @@ m4_foreach([OPTION], [[[--no-touch]], [[--no-touch-headers]]], AT_KEYWORDS([option])dnl # Sanity check for make implementation -touch test.h; touch test-h +echo >>test.h; echo >>test-h AT_CHECK([mtime_uptodate test-h test.h || exit 77]) -TEST_MTIME_DELAY; touch test.h +TEST_MTIME_DELAY; echo >>test.h AT_CHECK([mtime_uptodate test-h test.h && exit 77], [1]) rm -f test.h @@ -299,14 +299,14 @@ AT_DATA([test.gob], [[class :Test from G:Object ]]) AT_CHECK([gob2 test.gob]) -touch test-c test-h test-private +echo >>test-c; echo >>test-h; echo >>test-private TEST_MTIME_DELAY AT_CHECK([gob2 test.gob]) AT_CHECK([mtime_uptodate test-c test.c], [1]) AT_CHECK([mtime_uptodate test-h test.h], [1]) AT_CHECK([mtime_uptodate test-private test-private.h], [1]) -touch test-c test-h test-private +echo >>test-c; echo >>test-h; echo >>test-private TEST_MTIME_DELAY AT_CHECK([gob2 test.gob OPTION]) AT_CHECK([mtime_uptodate test-c test.c], @@ -319,7 +319,7 @@ cat >>test.gob <<'EOF' /* some code */ %} EOF -touch test-c test-h test-private +echo >>test-c; echo >>test-h; echo >>test-private TEST_MTIME_DELAY AT_CHECK([gob2 test.gob OPTION]) AT_CHECK([mtime_uptodate test-c test.c], [1]) @@ -331,7 +331,7 @@ cat >>test.gob <<'EOF' /* yonder comment */ %} EOF -touch test-c test-h test-private +echo >>test-c; echo >>test-h; echo >>test-private TEST_MTIME_DELAY AT_CHECK([gob2 test.gob OPTION]) AT_CHECK([mtime_uptodate test-c test.c], @@ -344,7 +344,7 @@ cat >>test.gob <<'EOF' /* once more unto the breach */ %} EOF -touch test-c test-h test-private +echo >>test-c; echo >>test-h; echo >>test-private TEST_MTIME_DELAY AT_CHECK([gob2 test.gob OPTION]) AT_CHECK([mtime_uptodate test-c test.c], -- 2.43.2