Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] testsuite: Make check-parallel return non-zero if a test failed
Date: Mon, 18 Jan 2016 22:49:00 -0000	[thread overview]
Message-ID: <1453157331-5472-1-git-send-email-simon.marchi@ericsson.com> (raw)

When using the check-parallel target, the return code of make is always 0,
regardless of test results.  This patch makes it return the same code as
the "make do-check-parallel" sub-command.  So if there is a FAIL somewhere,
non-zero will be returned by make.

For the sake of example, I introduced a failure in gdb.base/break.exp.

  $ make check-single TESTS="gdb.base/break.exp gdb.python/py-value.exp" && echo 'Success :D' || echo 'Fail :('
  ...
  FAIL: gdb.base/break.exp: allo
  ...
  Fail :(

I think the parallel run should do the same.  Currently:

  $ make check-parallel TESTS="gdb.base/break.exp gdb.python/py-value.exp" && echo 'Success :D' || echo 'Fail :('
  ...
  FAIL: gdb.base/break.exp: allo
  ...
  Success :D

And with the patch (no big surprises there):

  $ make check-parallel TESTS="gdb.base/break.exp gdb.python/py-value.exp" && echo 'Success :D' || echo 'Fail :('
  ...
  FAIL: gdb.base/break.exp: allo
  ...
  Fail :(

What do you think?

gdb/testsuite/ChangeLog:

	* Makefile.in (check-parallel): Propagate return code from make
	do-check-parallel.
---
 gdb/testsuite/Makefile.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index ae7fa7b..50edf8a 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -198,11 +198,13 @@ check-single:
 check-parallel:
 	-rm -rf cache outputs temp
 	$(MAKE) -k do-check-parallel; \
+	result=$$?; \
 	$(SHELL) $(srcdir)/dg-extract-results.sh \
 	  `find outputs -name gdb.sum -print` > gdb.sum; \
 	$(SHELL) $(srcdir)/dg-extract-results.sh -L \
-	  `find outputs -name gdb.log -print` > gdb.log
-	@sed -n '/=== gdb Summary ===/,$$ p' gdb.sum
+	  `find outputs -name gdb.log -print` > gdb.log; \
+	sed -n '/=== gdb Summary ===/,$$ p' gdb.sum; \
+	exit $$result
 
 # Turn a list of .exp files into "check/" targets.  Only examine .exp
 # files appearing in a gdb.* directory -- we don't want to pick up
-- 
2.5.1


             reply	other threads:[~2016-01-18 22:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 22:49 Simon Marchi [this message]
2016-01-19 11:15 ` Pedro Alves
2016-01-19 15:51   ` Simon Marchi

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=1453157331-5472-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --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