From cef4dc7158e1aa8b54b8e0eb47a44716461f60ba Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 9 Jul 2024 15:35:13 -0700 Subject: [PATCH] test: explanation of MTIME_RESOLUTION resetting. * t/ax/test-defs.in (MTIME_RESOLUTION): separate the case where am_cv_filesystem_timestamp_resolution is not set for more explanations, but still reset MTIME_RESOLUTION to 1 even if it is already set. Which it should be when running tests, because config.status is sourced. But it's too late in the release process to change this now; after the release, can try keeping a non-empty MTIME_RESOLUTION. --- t/ax/test-defs.in | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in index 542305788..21561a570 100644 --- a/t/ax/test-defs.in +++ b/t/ax/test-defs.in @@ -23,8 +23,7 @@ # - This code has to be 'set -e' clean. # See whether the current test script is expected to use TAP or not. -# Use a sensible default, while allowing the scripts to override this -# check. +# Use a sensible default, while allowing the scripts to override this check. if test -z "$am_test_protocol"; then case $argv0 in *.tap) am_test_protocol=tap;; @@ -191,24 +190,36 @@ case $MTIME_RESOLUTION in $AUTOM4TE --version 2>&1 | grep 'Features:.*subsecond-mtime' > /dev/null 2>&1; then # subsecond-mtime should be supported; use the timestamp - # resolution that we determined. If it hasn't been determined, - # that's a bug somewhere. + # resolution that we determined. if test -n "$am_cv_filesystem_timestamp_resolution"; then - #echo "$me: got $am_cv_filesystem_timestamp_resolution" >&2 + #echo "$BASH_SOURCE: amftr=$am_cv_filesystem_timestamp_resolution" >&2 MTIME_RESOLUTION=$am_cv_filesystem_timestamp_resolution + + elif test -n "$MTIME_RESOLUTION"; then + #echo "$BASH_SOURCE: M_R=$MTIME_RESOLUTION" >&2 + # This is normal when running tests: the cache variable is + # not set, but MTIME_RESOLUTION is, because config.status is sourced. + # Its value should be usable, but because this was discovered + # just before the 1.17 release, for safety, let's set it to 1, + # and try it after the release. + MTIME_RESOLUTION=1 + + # If MTIME_RESOLUTION is empty too, that's weird. else - # ends up in test-suite.log. + # This message ends up in test-suite.log. echo "$me: subsecond-mtime supported per automake and auto4mte" \ - "--version, but am_cv_filesystem_timestamp_resolution not set;" \ - "that's an error somewhere. Proceeding with value 1." >&2 + "--version, but neither am_cv_filesystem_timestamp_resolution;" \ + "nor MTIME_RESOLUTION are set; that's an error somewhere." \ + "Proceeding with value 1." >&2 MTIME_RESOLUTION=1 fi else - #echo "$me: --version doesn't support subsecond-mtime" >&2 + #echo "$BASH_SOURCE: some --version doesn't support subsecond-mtime" >&2 #$AUTOMAKE --version >&2 #$AUTOM4TE --version >&2 # MTIME_RESOLUTION=1 + # # we must not sleep for fractional seconds when autom4te does not # support subsecond-mtimes, even when sleep supports it. See bug#67670. am_cv_sleep_fractional_seconds=no -- 2.47.3