This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] testsuite: Make check-parallel return non-zero if a test failed
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 19 Jan 2016 15:47:34 -0000
- Subject: [binutils-gdb] testsuite: Make check-parallel return non-zero if a test failed
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bef95aacb8501edb086381b3d413485d732f00f3
commit bef95aacb8501edb086381b3d413485d732f00f3
Author: Simon Marchi <simon.marchi@ericsson.com>
Date: Mon Jan 18 14:07:10 2016 -0500
testsuite: Make check-parallel return non-zero if a test failed
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.
Diff:
---
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 fb0d8e5..6e5b1e9 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