]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
automake: improve debuggability of installcheck failures.
authorBruno Haible <bruno@clisp.org>
Sat, 21 Jun 2025 01:06:20 +0000 (18:06 -0700)
committerKarl Berry <karl@freefriends.org>
Sat, 21 Jun 2025 01:06:20 +0000 (18:06 -0700)
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.

NEWS
lib/am/progs.am
lib/am/scripts.am

diff --git a/NEWS b/NEWS
index ac193097133079ca471d7060d64c8d91544095da..35c36a7fe6ef37453cf8fda40fc83b9ed0aa801e 100644 (file)
--- 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)
 
index 4be52e5e31b010e906008e92052fcae11d08b490..e44289f220bcec536e45e916bcd3a59049fbbcc7 100644 (file)
@@ -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 </dev/null \
-                && test -n "`cat c$${pid}_.out`" \
-                && test -z "`cat c$${pid}_.err`"; then :; \
-           else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+           "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt \
+             >c$${pid}_.out 2>c$${pid}_.err </dev/null; \
+           xc=$$?; \
+           if test -n "`cat c$${pid}_.err`"; then \
+             echo "$$f does not support $$opt: error output" 1>&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%
index 2d0a1c768bb79c418452c30b867e753d8ea81437..966c0b83fe9d5cf5425224607340ad873465fcc4 100644 (file)
@@ -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 </dev/null \
-                && test -n "`cat c$${pid}_.out`" \
-                && test -z "`cat c$${pid}_.err`"; then :; \
-           else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+           "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt \
+             >c$${pid}_.out 2>c$${pid}_.err </dev/null; \
+           xc=$$?; \
+           if test -n "`cat c$${pid}_.err`"; then \
+             echo "$$f does not support $$opt: error output" 1>&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%