automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parallel-tests: redo lazy checking: recheck and RECHECK_LOGS.


From: Ralf Wildenhues
Subject: Re: parallel-tests: redo lazy checking: recheck and RECHECK_LOGS.
Date: Sat, 25 Apr 2009 10:44:09 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Akim,

* Akim Demaille wrote on Mon, Mar 30, 2009 at 09:50:59PM CEST:
> Le 29 mars 09 à 00:04, Ralf Wildenhues a écrit :
>
>> One thing that one needs to look out for is, when overriding variables
>> in recursive `make' instances is that non-GNU make don't override by
>> default unless you use `make -e' and pass via the environment.
>> Requiring our users to do so if they want to override variables is ok
>> IMVHO, because then they are warned that their environment needs to be
>> clean.  OTOH using -e internally is not ok at all, as the users may  
>> not be aware, and their environment could cause subtle breakage.  So
>> consequently we can only transport overrides one recursion deep and
>> not any further, unless each lower re-sets the variables on the make
>> command line.

> I have not understood exactly what you are referring too, but why don't 
> we just pass TESTS=$(TESTS) explicitly?  Or ask the users to add his 
> "precious macros" to AM_MAKEFLAGS?

Thank you!  Suddenly I noticed that your remark provides a really simple
(maybe simplistic) and neat solution to one of the remaining open
portability issues here.

Here's a quick recap, for those of you not following closely.  ;-)

With Solaris make (and some others), the recheck code doesn't work
correctly due to the issue described here:
<http://www.gnu.org/software/autoconf/manual/html_node/Macros-and-Submakes.html>
It applies in this case because there are (potentially) several
'make' recursions involved:
  recheck -> check -> check-TESTS -> $(TEST_SUITE_LOG)
  recheck-html -> check-html --> check -> check-TESTS -> $(TEST_SUITE_LOG)
                             `-> $(TEST_SUITE_HTML)

The effect is that, with Solaris make, `make recheck' will simply rerun
all tests, instead of only failed ones.

Possible solutions:
- add TEST_LOGS=... overrides to all of the above rules in the chain,
- add more helper variables for overrides to all of the above rules.

The former has the already-mentioned drawback that it could run us into
command line length limits, the latter is just a wee bit ugly.

The patch below (ab)uses AM_MAKEFLAGS to transport things through more
than one layer of sub-makes, without touching all the intermediate
rules.  It will break if the user sets AM_MAKEFLAGS herself and uses
single quotes in that setting.  Oh well, recheck is a new feature, so
I guess this isn't a regression.  ;-)

Pushed to master.  The testsuite addition merely ensures that the
override not only arrives at the check-TESTS rule, but also at the
$(TEST_SUITE_LOG) rule.

Cheers,
Ralf

    parallel-tests: fix recheck* targets for non-GNU make.
    
    * lib/am/check.am (recheck recheck-html): Override AM_MAKEFLAGS
    to portably transport the TEST_LOGS settings through the
    recursive `make' invocations.  Fixes parallel-tests9.test
    failure with Solaris make.
    * tests/parallel-tests9.test: Also ensure that the test
    summary is correct for `recheck'.
    Suggestion by Akim Demaille.

diff --git a/lib/am/check.am b/lib/am/check.am
index 271720d..6653f7b 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -289,7 +289,7 @@ recheck recheck-html:
                  case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
                else echo $$f; fi;                                      \
              done | tr '\012\015' '  '`;                               \
-       $(MAKE) $(AM_MAKEFLAGS) $$target TEST_LOGS="$$list"
+       $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) 
TEST_LOGS="'"$$list"'"'
 
 .PHONY: recheck recheck-html
 .MAKE: recheck recheck-html
diff --git a/tests/parallel-tests9.test b/tests/parallel-tests9.test
index e1f088b..a0cb585 100755
--- a/tests/parallel-tests9.test
+++ b/tests/parallel-tests9.test
@@ -65,6 +65,7 @@ cat stdout
 grep foo.test stdout && Exit 1
 grep bar.test stdout || Exit 1
 grep baz.test stdout || Exit 1
+grep '2 of 2.*failed' stdout
 
 # If we cannot read the log file, then redo it as well.
 chmod a-r foo.log




reply via email to

[Prev in Thread] Current Thread [Next in Thread]