]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] contrib: rewrite and fix 'check-html' and 'recheck-html'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 19:51:28 +0000 (21:51 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 19:51:28 +0000 (21:51 +0200)
That has actually been broken for some time, due to the changes
done in Automake-NG proper in the meantime.

* contrib/check-html.am (.log.html): Re-declare this suffix rule ...
(%.html: %.log): ... as a pattern rule.
(mostlyclean-check-html): Remove, instead ...
(MOSTLYCLEANFILES): ... appending to this variable.  Not only this
reduce the code size, but will give us resilience against possible
exceeded command line length limits for free.
(check-html, recheck-html): Rewrite as static pattern rules.  Fix
the recursive "make check" and "make recheck" invocation to override
TESTS, not TEST_LOGS (the latter override is not honoured anymore
by the new incarnation of the parallel-test rules).
* contrib/t/parallel-tests-html-recursive.sh: Adjust a little, by
initializing 'MOSTLYCLEANFILES' (to empty) in all the 'Makefile.am'
files that use 'check-html.am'.
* contrib/t/parallel-tests-html.sh: Likewise.  Also, since the
parallel-tests API does not allow command-line overriding of
TEST_LOGS anymore, stop doing that.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
contrib/check-html.am
contrib/t/parallel-tests-html-recursive.sh
contrib/t/parallel-tests-html.sh

index 2604c5ec8a2e6f1f3505a0317662c0e457a76003..ddcb5015cf4a52be6e4cd1ee41611a9f2107817b 100644 (file)
 
 TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 
-mostlyclean-local: mostlyclean-check-html
-.PHONY: mostlyclean-check-html
-mostlyclean-check-html:
-## Expand $(TEST_LOGS) only once, to avoid exceeding line length limits.
-       list='$(TEST_LOGS:.log=.html)'; test -z "$$list" || rm -f $$list
-       rm -f $(TEST_SUITE_HTML)
+## This expects MOSTLYCLEANFILES to be pre-defined by the clients (even
+## if just to the empty value).  Not ans unreasonable request.
+MOSTLYCLEANFILES += $(TEST_SUITE_HTML) $(TEST_LOGS:.log=.html)
 
-.log.html:
+%.html: %.log
        @list='$(RST2HTML) rst2html rst2html.py';                       \
        while :; do                                                     \
          for r2h in $$list; do                                         \
@@ -45,12 +42,11 @@ mostlyclean-check-html:
 # Beware of concurrent executions.  Run "check" not "check-TESTS", as
 # check-SCRIPTS and other dependencies are rebuilt by the former only.
 # And expect check to fail.
-check-html recheck-html:
-       @target=`echo $@ | sed 's/-html$$//'`; \
-       rv=0; $(MAKE) $$target || rv=$$?; \
-## The nullification of $(TEST_LOGS) is required to ensure that
+check-html recheck-html: %-html:
+       @rv=0; $(MAKE) $* || rv=$$?; \
+## The nullification of $(TESTS) is required to ensure that
 ## "make recheck-html" do not try to uselessly re-run tests.
-       $(MAKE) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \
+       $(MAKE) $(TEST_SUITE_HTML) TESTS= || exit 4; \
        exit $$rv
 
 .PHONY: check-html recheck-html
index 12d967ecff28cc91674d49025c72373e9d878795..e58cca904bbbdeaadd2ce85838be4237f6b54518 100755 (executable)
@@ -34,6 +34,9 @@ cp "$am_top_srcdir"/contrib/check-html.am . \
 
 cat >> configure.ac << 'END'
 AM_EXTRA_RECURSIVE_TARGETS([check-html])
+# This variable must be defined in each Makefile.am that includes
+# 'check-html.am'.  It's simpler to do this once here.
+AC_SUBST([MOSTLYCLEANFILES], [])
 AC_CONFIG_FILES([sub/Makefile sub/more/Makefile])
 AC_OUTPUT
 END
@@ -106,7 +109,6 @@ test ! -f test.log
 test -f x.txt
 END
 
-
 cat > sub/more/mu << 'END'
 #!/bin/sh
 exit 99
index 78cae7a19e356eb1303273eab5cd0c7f10736edd..6e853ab072a27f9710ffcbbff2c01c0ddeed7f0f 100755 (executable)
@@ -45,6 +45,8 @@ check_SCRIPTS = bla
 bla:
        echo bla > $@
 CLEANFILES = bla
+## Initialization of this required by 'check-html.am', below.
+MOSTLYCLEANFILES =
 include $(srcdir)/check-html.am
 END
 
@@ -120,7 +122,7 @@ test ! -e mylog.html
 
 $MAKE clean
 test ! -e mylog.html
-$MAKE check-html TEST_LOGS=foo.log
+$MAKE check-html TESTS=foo
 test -f bla
 test -f foo.log
 test ! -e bar.log