From: Bruno Haible Date: Sat, 21 Jun 2025 01:06:20 +0000 (-0700) Subject: automake: improve debuggability of installcheck failures. X-Git-Tag: v1.18.1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5feae5cfabd0d36e021a4d0ae21f94e88a934159;p=thirdparty%2Fautomake.git automake: improve debuggability of installcheck failures. From https://bugs.gnu.org/78850. * lib/am/progs.am (installcheck-%DIR%PROGRAMS): Show the cause of each failure. * lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise. * NEWS: mention this. --- diff --git a/NEWS b/NEWS index ac1930971..35c36a7fe 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ please see NEWS-future and start following the advice there now. * Bugs fixed + - Improve debuggability of installcheck failures. (bug#78850) + - Keep Automake tests working when SOURCE_DATE_EPOCH is set. (https://lists.gnu.org/archive/html/automake/2025-06/msg00016.html) diff --git a/lib/am/progs.am b/lib/am/progs.am index 4be52e5e3..e44289f22 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -137,11 +137,26 @@ installcheck-%DIR%PROGRAMS: $(%DIR%_PROGRAMS) ## Insert the directory back if nobase_ is used. ?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \ for opt in --help --version; do \ - if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \ - 2>c$${pid}_.err &2; bad=1; fi; \ + "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt \ + >c$${pid}_.out 2>c$${pid}_.err &2; \ + cat c$${pid}_.err 1>&2; \ + bad=1; \ + else \ + if test -z "`cat c$${pid}_.out`"; then \ + echo "$$f does not support $$opt: no output" 1>&2; \ + bad=1; \ + else \ + if test $$xc != 0; then \ + echo "$$f does not support $$opt: exit code $$xc" 1>&2; \ + bad=1; \ + else \ + :; \ + fi; \ + fi; \ + fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad endif %?CK-OPTS% diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 2d0a1c768..966c0b83f 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -117,11 +117,26 @@ installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS) ## Insert the directory back if nobase_ is used. ?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \ for opt in --help --version; do \ - if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \ - 2>c$${pid}_.err &2; bad=1; fi; \ + "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt \ + >c$${pid}_.out 2>c$${pid}_.err &2; \ + cat c$${pid}_.err 1>&2; \ + bad=1; \ + else \ + if test -z "`cat c$${pid}_.out`"; then \ + echo "$$f does not support $$opt: no output" 1>&2; \ + bad=1; \ + else \ + if test $$xc != 0; then \ + echo "$$f does not support $$opt: exit code $$xc" 1>&2; \ + bad=1; \ + else \ + :; \ + fi; \ + fi; \ + fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad endif %?CK-OPTS%