testsuite: Make check-parallel return non-zero if a test failed
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 18 Jan 2016 19:07:10 +0000 (14:07 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 19 Jan 2016 15:45:57 +0000 (10:45 -0500)
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

index fb0d8e5c98e3e9594b1acee57eeebcfccafb65be..6e5b1e994f2099ea64decad08c61c435f9173c93 100644 (file)
@@ -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
This page took 0.030743 seconds and 4 git commands to generate.