Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/4] gdb/testsuite: Factor out dg-extract-results.sh calls
Date: Thu, 23 Jul 2026 18:51:29 +0100	[thread overview]
Message-ID: <20260723175131.266112-3-pedro@palves.net> (raw)
In-Reply-To: <20260723175131.266112-1-pedro@palves.net>

The parallel-testing targets in the testsuite Makefile each combine
the per-test gdb.sum / gdb.log files produced by a run into a single
combined pair, using contrib/dg-extract-results.sh.  The same pair of
invocations (once for gdb.sum, once with -L for gdb.log) is copied in
check-parallel, check-parallel-racy, and check-all-boards, each only
differing in the input and output directories.

Factor those invocations into a DG_EXTRACT_RESULTS canned recipe
parameterized by the input and output directories, and use it from all
three targets.

Change-Id: Ia3417c9410b87a415cb9b104efa60d4bfb9ffbc5
---
 gdb/testsuite/Makefile.in | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index f103d7ddd65..fb312583b0e 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -254,16 +254,23 @@ check-single-racy:
 	  `ls racy_outputs/*/gdb.sum` > racy.sum; \
 	sed -n '/=== gdb Summary ===/,$$ p' racy.sum
 
+# Combine the individual gdb.sum / gdb.log files found anywhere under
+# directory $(1) into a single gdb.sum / gdb.log pair in directory
+# $(2), using contrib/dg-extract-results.sh.
+define DG_EXTRACT_RESULTS
+	$(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \
+	  `find $(1) -name gdb.sum -print` > $(2)/gdb.sum; \
+	$(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \
+	  `find $(1) -name gdb.log -print` > $(2)/gdb.log
+endef
+
 check-parallel:
 	-rm -f *core*
 	-rm -rf cache outputs temp
 	$(MAKE) -k do-check-parallel; \
 	result=$$?; \
 	if test -d outputs; then \
-	  $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \
-	    `find outputs -name gdb.sum -print` > gdb.sum; \
-	  $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \
-	    `find outputs -name gdb.log -print` > gdb.log; \
+	  $(call DG_EXTRACT_RESULTS,outputs,.); \
 	  $(SHELL) $(srcdir)/lib/dg-add-core-file-count.sh; \
 	  sed -n '/=== gdb Summary ===/,$$ p' gdb.sum; \
 	fi; \
@@ -282,12 +289,7 @@ check-parallel-racy:
 	for n in `seq $$racyiter` ; do \
 	  $(MAKE) -k do-check-parallel-racy \
 	    RACY_OUTPUT_N=$$n; \
-	  $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \
-	    `find racy_outputs/$$n -name gdb.sum -print` > \
-	    racy_outputs/$$n/gdb.sum; \
-	  $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \
-	    `find racy_outputs/$$n -name gdb.log -print` > \
-	    racy_outputs/$$n/gdb.log; \
+	  $(call DG_EXTRACT_RESULTS,racy_outputs/$$n,racy_outputs/$$n); \
 	  sed -n '/=== gdb Summary ===/,$$ p' racy_outputs/$$n/gdb.sum; \
 	done; \
 	$(srcdir)/analyze-racy-logs.py \
@@ -389,10 +391,7 @@ check-all-boards: all $(abs_builddir)/site.exp
 		"$(TESTS)" \
 	result=$$?; \
 	if test -d check-all; then \
-	  $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \
-	    `find check-all -name gdb.sum -print` > check-all/gdb.sum; \
-	  $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \
-	    `find check-all -name gdb.log -print` > check-all/gdb.log; \
+	  $(call DG_EXTRACT_RESULTS,check-all,check-all); \
 	  sed -n '/=== gdb Summary ===/,$$ p' check-all/gdb.sum; \
 	fi; \
 	exit $$result
-- 
2.54.0


  parent reply	other threads:[~2026-07-23 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 17:51 [PATCH 0/4] Avoid command-line length limit combining test results Pedro Alves
2026-07-23 17:51 ` [PATCH 1/4] dg-extract-results.{sh, py}: Optionally read file list from stdin/file Pedro Alves
2026-07-23 17:51 ` Pedro Alves [this message]
2026-07-23 17:51 ` [PATCH 3/4] gdb/testsuite: Add extract-results make target Pedro Alves
2026-07-23 17:51 ` [PATCH 4/4] gdb/testsuite: Pipe the dg-extract-results file list via stdin Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260723175131.266112-3-pedro@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox